Public report of BaseXdb/basex, published 17 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.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, 17 November 2026, 07:46 UTC · Survey ID cd_bdcbb537c9834a1b97a5223aaff0b43f
BaseXdb/basex
Measured 17 November 2026, 07:45 UTC, at code version 72d4c43
First survey, so nothing to compare with yet
CAI scoreWeak
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 large codebase: 267,139 lines of product code in 9 projects, tests not counted · Estimated rebuild effort: about 2.1 person-years · Weakest lens: Code Health, 30.2
Findings by how serious they are
28 critical1891 serious1191 minor
13 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 07:45 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 ▸
52of 52 dimensions measured by tools.
3099of 3110 findings point to an exact file and line, so you can open each one in the code. The other 11 concern the repository as a whole, such as missing documentation.
52dimensions across 7 lenses, read from 267,139 lines of product code in 9 projects.
BaseXdb/basex falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 42.5 out of 100 and is rated Weak, and 25 of its 28 critical findings are security problems.
Code Health, at 30.2, is the weakest lens and counts most in the score. The best first step is adding type checking, worth about 5.1 points. Splitting the oversized files comes next, worth about 4.7 points. Raising Code Health to 70 would lift the score to about 52.3.
Eleven pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Eleven weaknesses in the code could be used by an attacker, and one automatic update takes new releases before a bad one can be spotted. Pinning each tool to an exact version, fixing the weaknesses the scanner points to and setting a waiting period for automatic updates would close these risks. Passing outside input through environment variables would fix the pipeline step that puts outside input straight into a shell command, and limiting each secret to its own step would deal with the secret exposed to more of the pipeline than needed. Separating the two clickable elements would take care of the clickable element inside another clickable element.
The product code is 267,139 lines, about €310,000 to rebuild. Three of our security checks couldn't finish, among them the one for known security holes in its packages, so those results are missing, not clean passes.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Code Health rose from 30.2 to 70, the lowest score rated Strong, the score would rise from 42.5 to about 52.3.
Code composition: what the lines of code are
Business logic 0%Supporting code 0%Tests 100%
Rebuild cost: about €310,000 · Estimate
Cost to rebuild
€100,000 to €520,000, for 1,709 to 5,421 hours of work, about 2.1 person-years for 1 to 5 engineers
Difficulty of the problem
Standard, 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.7 at a score of 43. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 267,139 lines of product code
Comment lines
The estimate prices 267,042 lines. Comment lines count towards the size of 267,139 lines but aren't priced as work.
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raises the score by about 5.1 points · Medium effort · Type Safety
2
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 4.7 points · Medium effort · Large Files
3
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 4.7 points · Medium effort · Keyboard semantics
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 €310,000 to build again, about 2.1 person-years of work. Its weakest lens is Code Health, at 30.2 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up. Of all the actions in this report, it raises the score most for the work it takes: about 5.1 points for medium effort. 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 7.1 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 200,462 lines over the last 90 days, which is about 812,985 lines a year. At that pace, the extra work comes to an estimated 44.4 to 271 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
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.
164 modules, with 1522 dependencies between them. 2 loops run through 91 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 124 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
query.value.array uses query.value.type, so a change to query.value.type can break query.value.array, while a change to query.value.array can't break query.value.type.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
1→15 query.value.array uses query.value.itempart of a loop✕
Connections
6 pairs of types, where a type in query.value.array uses a type in query.value.item.
query.value.array uses query.value.item, so a change to query.value.item can break query.value.array, while a change to query.value.array can't break query.value.item.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
1→19 query.value.array uses query.valuepart of a loop✕
Connections
16 pairs of types, where a type in query.value.array uses a type in query.value.
query.value.array uses query.value, so a change to query.value can break query.value.array, while a change to query.value.array can't break query.value.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
1→20 query.value.array uses query.iterpart of a loop✕
Connections
3 pairs of types, where a type in query.value.array uses a type in query.iter.
query.value.node uses query.value.type, so a change to query.value.type can break query.value.node, while a change to query.value.node can't break query.value.type.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→15 query.value.node uses query.value.itempart of a loop✕
Connections
14 pairs of types, where a type in query.value.node uses a type in query.value.item.
query.value.node uses query.value.item, so a change to query.value.item can break query.value.node, while a change to query.value.node can't break query.value.item.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→16 query.value.node uses query.util.listpart of a loop✕
Connections
2 pairs of types, where a type in query.value.node uses a type in query.util.list.
query.value.node uses query.util.list, so a change to query.util.list can break query.value.node, while a change to query.value.node can't break query.util.list.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→19 query.value.node uses query.valuepart of a loop✕
Connections
3 pairs of types, where a type in query.value.node uses a type in query.value.
query.value.node uses query.expr.path, so a change to query.expr.path can break query.value.node, while a change to query.value.node can't break query.expr.path.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→22 query.value.node uses query.exprpart of a loop✕
Connections
1 pair of types, where a type in query.value.node uses a type in query.expr.
32 pairs of types, where a type in query.value.node uses a type in query. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.value.type uses query.value.array, so a change to query.value.array can break query.value.type, while a change to query.value.type can't break query.value.array.
Position
Below the diagonal: query.value.type uses a module listed above it, which is the healthy direction.
query.value.type uses query.value.node, so a change to query.value.node can break query.value.type, while a change to query.value.type can't break query.value.node.
Position
Below the diagonal: query.value.type uses a module listed above it, which is the healthy direction.
7→8 query.value.type uses query.value.mappart of a loop✕
Connections
3 pairs of types, where a type in query.value.type uses a type in query.value.map.
query.value.type uses query.value.map, so a change to query.value.map can break query.value.type, while a change to query.value.type can't break query.value.map.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
7→15 query.value.type uses query.value.itempart of a loop✕
Connections
115 pairs of types, where a type in query.value.type uses a type in query.value.item. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.value.type uses query.value.item, so a change to query.value.item can break query.value.type, while a change to query.value.type can't break query.value.item.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
7→16 query.value.type uses query.util.listpart of a loop✕
Connections
3 pairs of types, where a type in query.value.type uses a type in query.util.list.
query.value.type uses query.util.list, so a change to query.util.list can break query.value.type, while a change to query.value.type can't break query.util.list.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
7→19 query.value.type uses query.valuepart of a loop✕
Connections
9 pairs of types, where a type in query.value.type uses a type in query.value.
query.value.type uses query.expr.path, so a change to query.expr.path can break query.value.type, while a change to query.value.type can't break query.expr.path.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
7→22 query.value.type uses query.exprpart of a loop✕
Connections
6 pairs of types, where a type in query.value.type uses a type in query.expr.
66 pairs of types, where a type in query.value.type uses a type in query. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
61 pairs of types, where a type in query.value.type uses a type in util. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
32 pairs of types, where a type in query.value.type uses a type in io.in. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
27 pairs of types, where a type in query.value.map uses a type in query.value.type. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.value.map uses query.value.type, so a change to query.value.type can break query.value.map, while a change to query.value.map can't break query.value.type.
Position
Below the diagonal: query.value.map uses a module listed above it, which is the healthy direction.
8→15 query.value.map uses query.value.itempart of a loop✕
Connections
43 pairs of types, where a type in query.value.map uses a type in query.value.item. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.value.map uses query.value.item, so a change to query.value.item can break query.value.map, while a change to query.value.map can't break query.value.item.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
8→17 query.value.map uses query.util.hashpart of a loop✕
Connections
2 pairs of types, where a type in query.value.map uses a type in query.util.hash.
query.value.map uses query.util.hash, so a change to query.util.hash can break query.value.map, while a change to query.value.map can't break query.util.hash.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
8→19 query.value.map uses query.valuepart of a loop✕
Connections
33 pairs of types, where a type in query.value.map uses a type in query.value. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.value.seq uses query.value.node, so a change to query.value.node can break query.value.seq, while a change to query.value.seq can't break query.value.node.
Position
Below the diagonal: query.value.seq uses a module listed above it, which is the healthy direction.
query.value.seq uses query.value.type, so a change to query.value.type can break query.value.seq, while a change to query.value.seq can't break query.value.type.
Position
Below the diagonal: query.value.seq uses a module listed above it, which is the healthy direction.
9→15 query.value.seq uses query.value.itempart of a loop✕
Connections
17 pairs of types, where a type in query.value.seq uses a type in query.value.item.
query.value.seq uses query.value.item, so a change to query.value.item can break query.value.seq, while a change to query.value.seq can't break query.value.item.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9→19 query.value.seq uses query.valuepart of a loop✕
Connections
18 pairs of types, where a type in query.value.seq uses a type in query.value.
query.value.seq uses query.expr.path, so a change to query.expr.path can break query.value.seq, while a change to query.value.seq can't break query.expr.path.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9→22 query.value.seq uses query.exprpart of a loop✕
Connections
9 pairs of types, where a type in query.value.seq uses a type in query.expr.
31 pairs of types, where a type in query.value.seq uses a type in query. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
util.options uses query.value.type, so a change to query.value.type can break util.options, while a change to util.options can't break query.value.type.
Position
Below the diagonal: util.options uses a module listed above it, which is the healthy direction.
util.options uses query.value.item, so a change to query.value.item can break util.options, while a change to util.options can't break query.value.item.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→19 util.options uses query.valuepart of a loop✕
Connections
2 pairs of types, where a type in util.options uses a type in query.value.
28 pairs of types, where a type in query.func uses a type in query.expr. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.func.fn uses query.value.array, so a change to query.value.array can break query.func.fn, while a change to query.func.fn can't break query.value.array.
Position
Below the diagonal: query.func.fn uses a module listed above it, which is the healthy direction.
query.func.fn uses query.value.node, so a change to query.value.node can break query.func.fn, while a change to query.func.fn can't break query.value.node.
Position
Below the diagonal: query.func.fn uses a module listed above it, which is the healthy direction.
query.func.fn uses query.value.type, so a change to query.value.type can break query.func.fn, while a change to query.func.fn can't break query.value.type.
Position
Below the diagonal: query.func.fn uses a module listed above it, which is the healthy direction.
query.func.fn uses query.value.map, so a change to query.value.map can break query.func.fn, while a change to query.func.fn can't break query.value.map.
Position
Below the diagonal: query.func.fn uses a module listed above it, which is the healthy direction.
query.func.fn uses query.value.seq, so a change to query.value.seq can break query.func.fn, while a change to query.func.fn can't break query.value.seq.
Position
Below the diagonal: query.func.fn uses a module listed above it, which is the healthy direction.
62 pairs of types, where a type in query.func.fn uses a type in util.options. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
141 pairs of types, where a type in query.func.fn uses a type in query.func. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.func.fn uses query.func, so a change to query.func can break query.func.fn, while a change to query.func.fn can't break query.func.
Position
Below the diagonal: query.func.fn uses a module listed above it, which is the healthy direction.
14→15 query.func.fn uses query.value.itempart of a loop✕
Connections
125 pairs of types, where a type in query.func.fn uses a type in query.value.item. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.func.fn uses query.value.item, so a change to query.value.item can break query.func.fn, while a change to query.func.fn can't break query.value.item.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
14→16 query.func.fn uses query.util.listpart of a loop✕
Connections
6 pairs of types, where a type in query.func.fn uses a type in query.util.list.
query.func.fn uses query.util.list, so a change to query.util.list can break query.func.fn, while a change to query.func.fn can't break query.util.list.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
14→17 query.func.fn uses query.util.hashpart of a loop✕
Connections
1 pair of types, where a type in query.func.fn uses a type in query.util.hash.
query.func.fn uses query.util.hash, so a change to query.util.hash can break query.func.fn, while a change to query.func.fn can't break query.util.hash.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
14→19 query.func.fn uses query.valuepart of a loop✕
Connections
163 pairs of types, where a type in query.func.fn uses a type in query.value. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.func.fn uses query.value, so a change to query.value can break query.func.fn, while a change to query.func.fn can't break query.value.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
14→20 query.func.fn uses query.iterpart of a loop✕
Connections
34 pairs of types, where a type in query.func.fn uses a type in query.iter. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.func.fn uses query.iter, so a change to query.iter can break query.func.fn, while a change to query.func.fn can't break query.iter.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
14→22 query.func.fn uses query.exprpart of a loop✕
Connections
142 pairs of types, where a type in query.func.fn uses a type in query.expr. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
431 pairs of types, where a type in query.func.fn uses a type in query. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
31 pairs of types, where a type in query.func.fn uses a type in util. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.value.item uses query.value.type, so a change to query.value.type can break query.value.item, while a change to query.value.item can't break query.value.type.
Position
Below the diagonal: query.value.item uses a module listed above it, which is the healthy direction.
query.value.item uses query.func.fn, so a change to query.func.fn can break query.value.item, while a change to query.value.item can't break query.func.fn.
Position
Below the diagonal: query.value.item uses a module listed above it, which is the healthy direction.
15→16 query.value.item uses query.util.listpart of a loop✕
Connections
2 pairs of types, where a type in query.value.item uses a type in query.util.list.
query.value.item uses query.util.list, so a change to query.util.list can break query.value.item, while a change to query.value.item can't break query.util.list.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15→19 query.value.item uses query.valuepart of a loop✕
Connections
5 pairs of types, where a type in query.value.item uses a type in query.value.
60 pairs of types, where a type in query.value.item uses a type in query. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
35 pairs of types, where a type in query.value.item uses a type in util. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.util.list uses query.value.node, so a change to query.value.node can break query.util.list, while a change to query.util.list can't break query.value.node.
Position
Below the diagonal: query.util.list uses a module listed above it, which is the healthy direction.
query.util.list uses query.value.type, so a change to query.value.type can break query.util.list, while a change to query.util.list can't break query.value.type.
Position
Below the diagonal: query.util.list uses a module listed above it, which is the healthy direction.
query.util.list uses query.value.item, so a change to query.value.item can break query.util.list, while a change to query.util.list can't break query.value.item.
Position
Below the diagonal: query.util.list uses a module listed above it, which is the healthy direction.
16→19 query.util.list uses query.valuepart of a loop✕
Connections
4 pairs of types, where a type in query.util.list uses a type in query.value.
query.util.hash uses query.value.item, so a change to query.value.item can break query.util.hash, while a change to query.util.hash can't break query.value.item.
Position
Below the diagonal: query.util.hash uses a module listed above it, which is the healthy direction.
query.util.hash uses query.util.list, so a change to query.util.list can break query.util.hash, while a change to query.util.hash can't break query.util.list.
Position
Below the diagonal: query.util.hash uses a module listed above it, which is the healthy direction.
17→25 query.util.hash uses query.utilpart of a loop✕
Connections
1 pair of types, where a type in query.util.hash uses a type in query.util.
28 pairs of types, where a type in query.expr.path uses a type in query.value.node. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.expr.path uses query.value.node, so a change to query.value.node can break query.expr.path, while a change to query.expr.path can't break query.value.node.
Position
Below the diagonal: query.expr.path uses a module listed above it, which is the healthy direction.
query.expr.path uses query.value.type, so a change to query.value.type can break query.expr.path, while a change to query.expr.path can't break query.value.type.
Position
Below the diagonal: query.expr.path uses a module listed above it, which is the healthy direction.
query.expr.path uses query.value.item, so a change to query.value.item can break query.expr.path, while a change to query.expr.path can't break query.value.item.
Position
Below the diagonal: query.expr.path uses a module listed above it, which is the healthy direction.
query.expr.path uses query.util.list, so a change to query.util.list can break query.expr.path, while a change to query.expr.path can't break query.util.list.
Position
Below the diagonal: query.expr.path uses a module listed above it, which is the healthy direction.
31 pairs of types, where a type in query.expr.path uses a type in query.iter. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
41 pairs of types, where a type in query.expr.path uses a type in query. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
33 pairs of types, where a type in query.expr.path uses a type in util. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
58 pairs of types, where a type in query.expr uses a type in util.hash. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
79 pairs of types, where a type in query.expr uses a type in query.var. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
42 pairs of types, where a type in query.expr uses a type in query.value.type. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
50 pairs of types, where a type in query.expr uses a type in query.value.item. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
49 pairs of types, where a type in query.expr uses a type in query.value. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
28 pairs of types, where a type in query.expr uses a type in query.iter. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
40 pairs of types, where a type in query.expr uses a type in query.util. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.expr.ft uses query.value.node, so a change to query.value.node can break query.expr.ft, while a change to query.expr.ft can't break query.value.node.
Position
Below the diagonal: query.expr.ft uses a module listed above it, which is the healthy direction.
query.expr.ft uses query.value.type, so a change to query.value.type can break query.expr.ft, while a change to query.expr.ft can't break query.value.type.
Position
Below the diagonal: query.expr.ft uses a module listed above it, which is the healthy direction.
query.expr.ft uses query.value.item, so a change to query.value.item can break query.expr.ft, while a change to query.expr.ft can't break query.value.item.
Position
Below the diagonal: query.expr.ft uses a module listed above it, which is the healthy direction.
71 pairs of types, where a type in query.expr.ft uses a type in query. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.up.primitives uses util.list, so a change to util.list can break query.up.primitives, while a change to query.up.primitives can't break util.list.
Position
Below the diagonal: query.up.primitives uses a module listed above it, which is the healthy direction.
query.up.primitives uses query.value.node, so a change to query.value.node can break query.up.primitives, while a change to query.up.primitives can't break query.value.node.
Position
Below the diagonal: query.up.primitives uses a module listed above it, which is the healthy direction.
query.up.primitives uses query.value.map, so a change to query.value.map can break query.up.primitives, while a change to query.up.primitives can't break query.value.map.
Position
Below the diagonal: query.up.primitives uses a module listed above it, which is the healthy direction.
query.up.primitives uses util.options, so a change to util.options can break query.up.primitives, while a change to query.up.primitives can't break util.options.
Position
Below the diagonal: query.up.primitives uses a module listed above it, which is the healthy direction.
query.up.primitives uses io.serial, so a change to io.serial can break query.up.primitives, while a change to query.up.primitives can't break io.serial.
Position
Below the diagonal: query.up.primitives uses a module listed above it, which is the healthy direction.
query.up.primitives uses query.value, so a change to query.value can break query.up.primitives, while a change to query.up.primitives can't break query.value.
Position
Below the diagonal: query.up.primitives uses a module listed above it, which is the healthy direction.
query.up.primitives uses core.users, so a change to core.users can break query.up.primitives, while a change to query.up.primitives can't break core.users.
Position
Below the diagonal: query.up.primitives uses a module listed above it, which is the healthy direction.
query.func.db uses query.value.node, so a change to query.value.node can break query.func.db, while a change to query.func.db can't break query.value.node.
Position
Below the diagonal: query.func.db uses a module listed above it, which is the healthy direction.
query.func.db uses query.value.type, so a change to query.value.type can break query.func.db, while a change to query.func.db can't break query.value.type.
Position
Below the diagonal: query.func.db uses a module listed above it, which is the healthy direction.
query.func.db uses query.value.map, so a change to query.value.map can break query.func.db, while a change to query.func.db can't break query.value.map.
Position
Below the diagonal: query.func.db uses a module listed above it, which is the healthy direction.
query.func.db uses query.value.item, so a change to query.value.item can break query.func.db, while a change to query.func.db can't break query.value.item.
Position
Below the diagonal: query.func.db uses a module listed above it, which is the healthy direction.
query.func.db uses query.util.hash, so a change to query.util.hash can break query.func.db, while a change to query.func.db can't break query.util.hash.
Position
Below the diagonal: query.func.db uses a module listed above it, which is the healthy direction.
32 pairs of types, where a type in query.func.db uses a type in query.value. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.func.db uses query.expr.path, so a change to query.expr.path can break query.func.db, while a change to query.func.db can't break query.expr.path.
Position
Below the diagonal: query.func.db uses a module listed above it, which is the healthy direction.
58 pairs of types, where a type in query.func.db uses a type in query. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.func.db uses query.up.primitives, so a change to query.up.primitives can break query.func.db, while a change to query.func.db can't break query.up.primitives.
Position
Below the diagonal: query.func.db uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 30.2 · Weak · gated by R1, R3, X5 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
39
High / Critical
A03:2025 — Software Supply Chain Failures
5
Medium
A02:2025 — Security Misconfiguration
2
Medium
Roadmap
Top priorities: Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up; Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package; Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Put every file in a nullable-enabled context — `#nullable enable` at its top, or commit a project file with <Nullable>enable</Nullable> — and resolve warnings rather than suppressing with `!`.
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 — 28
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 — 1891
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 — 1191
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 13
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 52 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 — 52 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 3099 of 3110 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: 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 — 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 repository's dependency manifests WERE read and their pinning discipline assessed; what went unanswered is the currency half, because files.basex.org — the registry that answers it — was asked and did not reply (the build stopped because files.basex.org, a repository this project declares, refused it with HTTP 403 — what this scan's egress allowlist returns for a host that is not on it, so the dependency graph was not resolved). This is OUR side and it is an ENVIRONMENT fault, not a missing collector: the collector exists and ran. An HTTP 403 here is what this scan's egress allowlist returns for a host that is not on it, so the remedy is to add files.basex.org to the allowlist and re-run — not to build anything.
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.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
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.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D30 Dependency Vulnerabilities — 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. Osv: osv-scanner exited 127 with no findings — dependency CVEs were not measured. 'osv-scanner' exited 127 and produced no findings, and that exit code has no documented repo-side meaning — so this run measured nothing, and nothing here is a statement about the repository.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `basex-core/src/main/java/org/basex/gui/layout/BaseXCombo.java`, `basex-core/src/main/java/org/basex/gui/layout/BaseXSerial.java`, `basex-core/src/main/java/org/basex/gui/view/editor/EditorView.java`, `basex-core/src/main/java/org/basex/query/expr/path/Path.java`, `basex-core/src/main/java/org/basex/query/func/db/DbOptionMap.java`, … (+8 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D43 Malicious Dependencies — 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. Osv: osv-scanner exited 127 with no findings — dependency CVEs were not measured. 'osv-scanner' exited 127 and produced no findings, and that exit code has no documented repo-side meaning — so this run measured nothing, and nothing here is a statement about the repository.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
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.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 8 further occurrence(s) are not listed individually; the score already reflects all 48.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository's C# was parsed (it ships no .sln or .csproj, so it was read as syntax-only projects), but this check proves its findings from resolved symbols and a reference-free parse resolves none. It abstained rather than report a clean bill it could not earn. That is a gap in this analyzer's reach into build-less repositories — not a finding that the repository is free of what this check looks for.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
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.
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.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
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").
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (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.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
338 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was XMLParser.command at 109. A further 11 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being StringParser.parse at 73 — they are counted neither in the figure above nor in this dimension's score. 7 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: basex-core/src/main/java/org/basex/core/parse/StringParser.java (StringParser.parse at 73), basex-core/src/main/java/org/basex/query/func/fn/FnOp.java (FnOp.value at 40), basex-core/src/main/java/org/basex/query/expr/CalcOpt.java (CalcOpt.get at 26), basex-core/src/main/java/org/basex/query/util/regex/Literal.java (Literal.escape at 23), basex-core/src/main/java/org/basex/query/expr/path/Axis.java (Axis.invert at 19), and 2 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 328 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 5 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with XMLParser.command (cyclomatic 109), SyntaxXQuery.scan (cyclomatic 69), js.shortcuts (cyclomatic 66). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 5 together lifts Cyclomatic Complexity from 5.9 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 696 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 120 down to 120 or less in Cognitive Complexity — start with SyntaxXQuery.scan (cognitive 166), QueryParser.dirElement (cognitive 150), MapRenderer.computeToolTip (cognitive 142). — 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 4.1 to about 4.6/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.6 / 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.
Resolve the 62 TooManyMethods finding(s) in God Classes — start with QueryParser.java, TextEditor.java, ParseExpr.java. — One of this dimension's main actionable groups (62 warning-level).
Resolve the 26 ClassTooLong finding(s) in God Classes — start with QueryParser.java, Function.java, TextEditor.java. — One of this dimension's main actionable groups (26 warning-level).
Resolve the 22 FileTooLong finding(s) in God Classes — start with QueryParser.java, Function.java, TextEditor.java. — One of this dimension's main actionable groups (22 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
132 duplicated block group(s) detected. 3.1 % of the production lines (8,199 of 260,854) are in a reported copy. A further 294 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 8 of the 426 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
Edited copy of a member (4 corresponding lines) · ×30basex-core/src/main/java/org/basex/query/expr/Unfold.java:508
Edited copy of a member (7 corresponding lines) · ×25basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:141
+ 106 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 30 Edited copy of a member (4 corresponding lines) finding(s) in Code Duplication — start with BXAttr.java (2), Unfold.java, FnLocalNameFromQName.java. — One of this dimension's main actionable groups (30 warning-level).
Resolve the 25 Edited copy of a member (7 corresponding lines) finding(s) in Code Duplication — start with CalcOpt.java, Recur.java, CacheGetOrPut.java. — One of this dimension's main actionable groups (25 warning-level).
Resolve the 24 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with LeafNode.java (2), Add.java, Intersect.java. — One of this dimension's main actionable groups (24 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling9.1 / 10Stronggated by 1 serious finding✓ 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.
9 production modules (Maven), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence, with abstractness counted on 5 of the 9 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: basex
What to do
Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 11 Low cohesion finding(s) in Cohesion (LCOM4) — start with Sftp.java, QueryException.java, Request.java. — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality9.9 / 10Stronggated by 13 serious findings✓ 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.
0 skipped, 1134 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1722 tests (2 harness-style project(s) excluded from the assertion penalty).
No assertions: ok · ×13basex-api/src/test/java/org/basex/http/auth/BasicAuthTest.java:35
No direct assertions: delete · ×1121basex-core/src/test/java/org/basex/query/func/fn/FnIdTest.java:25
What to do
Resolve the 1121 No direct assertions finding(s) in Test Quality — start with RewritingsTest.java (212), FnModuleTest.java (166), UpdateTest.java (134). — One of this dimension's main actionable groups (1121 recommendation-level).
Resolve the 13 No assertions finding(s) in Test Quality — start with WebDAVTest.java (11), BasicAuthTest.java, FnHttpTest.java. — One of this dimension's main actionable groups (13 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 5 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 12 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. 57 further coordinate(s) are declared with no version at the declaration site — inherited from a parent POM, a BOM or an unresolved Gradle version reference — and are NOT graded: this verdict covers what the checkout pins, not the full transitive graph. A further 3 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.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: basex-core/src/main/java/org/basex/query/QueryParser.java (74×39=2886); basex-core/src/main/java/org/basex/query/expr/SimpleMap.java (24×65=1560); basex-core/src/main/java/org/basex/query/expr/path/Path.java (40×36=1440) Repeated repair below the complexity floor: basex-core/src/main/java/org/basex/query/value/node/DBNode.java (9 of 14 changes were fixes); basex-core/src/main/java/org/basex/query/StaticContext.java (8 of 12 changes were fixes); basex-core/src/main/java/org/basex/query/up/expr/TransformWith.java (8 of 12 changes were fixes)
Resolve the 133 Hotspot finding(s) in Churn × Complexity Hotspots — start with XMLParser.java (2), Replace.java (2), QueryParser.java. — One of this dimension's main actionable groups (133 warning-level).
Resolve the 88 Repeated repair finding(s) in Churn × Complexity Hotspots — start with Copy.java (2), DBNode.java, StaticContext.java. — One of this dimension's main actionable groups (88 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor3.4 / 10Weak✓ 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.
613 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is basex-core/src/main/java/org/basex/query/QueryError.java. Counted over 925 of the 2218 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
0 deducted task-comment markers across 260854 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
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.
1 of 1 documentation facets pass in full. 5 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
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.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
4 naming inconsistencies among 88 declarations measured against a convention their peers follow.
`scanCONTENT` spells `CONTENT` where 19 names in the project spell it `Content`basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:183
`scanELEMENT` spells `ELEMENT` where 29 names in the project spell it `Element`basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:232
`cDATA` spells `DATA` where 56 names in the project spell it `Data`basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:375
`SyntaxXML` spells `XML` where 130 names in the project spell it `Xml`basex-core/src/main/java/org/basex/gui/text/SyntaxXML.java:19
What to do
Resolve the 1 `scanCONTENT` spells `CONTENT` where 19 names in the project spell it… finding(s) in Naming Consistency — start with XMLScanner.java. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `scanELEMENT` spells `ELEMENT` where 29 names in the project spell it… finding(s) in Naming Consistency — start with XMLScanner.java. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `cDATA` spells `DATA` where 56 names in the project spell it `Data` finding(s) in Naming Consistency — start with XMLScanner.java. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
75 % of calls cross a namespace and 6 % 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.
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.
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).
39 finding(s): 0 critical, 25 high, 11 medium, 3 low. 11 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 13 file(s) — `basex-core/src/main/java/org/basex/gui/layout/BaseXCombo.java` (line 331, line 332, line 333, …), `basex-core/src/main/java/org/basex/gui/layout/BaseXSerial.java` (lines 99–109, line 110, line 111, …), `basex-core/src/main/java/org/basex/gui/view/editor/EditorView.java` (line 875, line 876, line 877), `basex-core/src/main/java/org/basex/query/expr/path/Path.java` (line 624, line 625, line 626), `basex-core/src/main/java/org/basex/query/func/db/DbOptionMap.java` (line 40, line 41, line 42, …), … (+8 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 8 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
No action in Static Analysis (SAST) — all 11 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 (11 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
11 of 925 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java. Counted over 925 of the 2218 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with DeepTree.java. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 10 Orphaned file finding(s) in Knowledge Freshness — start with InnerNode.java, FingerTreeBuilder.java, FingerTreeIterator.java. — One of this dimension's main actionable groups (10 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 8 Change coupling finding(s) in Change Coupling — start with Function.java, editor.js, JobContext.java. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with XQMap.java. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 9 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Do you agree with this assessment?
AC3 · Page structure4.6 / 10Weak✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — basex-examples/src/main/resources/html/news.html:2
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — basex-examples/src/main/resources/html/news.html:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. — basex-modules/chat/src/main/resources/static/chat.js:131
This <span> carries its own click handler, but it sits inside a <button> that performs a different action. A keyboard user reaches the <button> and activating it runs the <button>'s handler, never this one, so this action has no keyboard path at all. Role and tabindex cannot supply one: HTML forbids a <button> from containing interactive content or any descendant with a tabindex, so the browser will not put this element in the tab order however it is marked up. Move it out of the <button> and make it a sibling <button>, so each action has its own control. — basex-modules/dba/src/main/resources/static/workspace.js:146
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
`:is(button.collapse, button.run):hover` sets color: #C33 on background-color: #EEE — 4.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — basex-modules/dba/src/main/resources/static/style.css:1361
`textarea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. (×4) — basex-modules/webdav/src/main/resources/static/style.css:240, basex-modules/dba/src/main/resources/static/style.css:450, basex-modules/chat/src/main/resources/static/style.css:240, …
`input[type=checkbox]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — basex-modules/dba/src/main/resources/static/style.css:257
`body .cm-editor.cm-focused` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — basex-modules/dba/src/main/resources/static/style.css:848
`dialog :not(button, input, select, textarea, a):focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — basex-modules/dba/src/main/resources/static/style.css:1146
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether 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.
`RequestState` declares 19 abstract methods: `attribute`, `attributes`, `contextPath`, `cookies`, `headerNames`, `headers`, `localAddress`, `method`, `query`, `remoteAddress`, `remoteHostname`, `remotePort`, `scheme`, `serverName`, `serverPort`, `session`, `setAttribute`, `uri`, `url`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — basex-api/src/main/java/org/basex/http/RequestState.java:18
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
1 public type in `org.basex.api.dom` is marked as implementation by its own namespace, folder or name: `BXDomImpl` (basex-core/src/main/java/org/basex/api/dom/BXDomImpl.java:12, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — basex-core/src/main/java/org/basex/api/dom/BXDomImpl.java:12
What to do
Hide `org.basex.api.dom` (`BXDomImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
Do you agree with this assessment?
P2 · Observability5.0 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 1/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `basex-api`, `basex-examples`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add a health-check endpoint (Spring Boot Actuator's /actuator/health, or a /health route) so orchestrators and load balancers can probe liveness/readiness.
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 2 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:8
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.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
0 typed · 17 plain JS — the untyped files are basex-api/src/main/javascript/AddExample.mjs, basex-api/src/main/javascript/BaseXClient.mjs, basex-api/src/main/javascript/CreateExample.mjs, basex-api/src/main/javascript/Example.mjs, basex-api/src/main/javascript/QueryBindExample.mjs, basex-api/src/main/javascript/QueryExample.mjs (+11 more).
What to do
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
basex-api/src/main/javascript/AddExample.mjs:7 · basex-api/src/main/javascript/CreateExample.mjs:7 — the two spans are one implementation copied and then locally edited — 85 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — basex-api/src/main/javascript/AddExample.mjs:7
basex-api/src/main/javascript/QueryBindExample.mjs:7 · basex-api/src/main/javascript/QueryExample.mjs:7 — the two spans are one implementation copied and then locally edited — 71 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — basex-api/src/main/javascript/QueryBindExample.mjs:7
basex-api/src/main/javascript/CreateExample.mjs:7 · basex-api/src/main/javascript/QueryBindExample.mjs:7 — the two spans are one implementation copied and then locally edited — 51 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — basex-api/src/main/javascript/CreateExample.mjs:7
basex-api/src/main/javascript/CreateExample.mjs:7 · basex-api/src/main/javascript/QueryExample.mjs:7 — the two spans are one implementation copied and then locally edited — 51 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — basex-api/src/main/javascript/CreateExample.mjs:7
basex-api/src/main/javascript/CreateExample.mjs:11 · basex-api/src/main/javascript/Example.mjs:14 — the two spans are one implementation copied and then locally edited — 51 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — basex-api/src/main/javascript/CreateExample.mjs:11
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
shortcuts has cyclomatic complexity 66 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — basex-modules/dba/src/main/resources/static/js.js:1256
workspaceKeys has cyclomatic complexity 25 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — basex-modules/dba/src/main/resources/static/workspace.js:885
closeTab has cyclomatic complexity 15 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — basex-modules/dba/src/main/resources/static/workspace.js:265
logEntries has cyclomatic complexity 15 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — basex-modules/dba/src/main/resources/static/logs.js:18
showActivity has cyclomatic complexity 14 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — basex-modules/dba/src/main/resources/static/activity.js:88
(anonymous) has cyclomatic complexity 14 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — basex-modules/dba/src/main/resources/static/js.js:835
showError has cyclomatic complexity 13 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — basex-modules/dba/src/main/resources/static/js.js:981
loadCodeMirror has cyclomatic complexity 12 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — basex-modules/dba/src/main/resources/static/editor.js:102
saveFile has cyclomatic complexity 12 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — basex-modules/dba/src/main/resources/static/workspace.js:717
resize has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — basex-modules/dba/src/main/resources/static/js.js:1933
Do you agree with this assessment?
R3 · Large Files0.6 / 10Critical✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
basex-modules/dba/src/main/resources/static/js.js has 1793 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — basex-modules/dba/src/main/resources/static/js.js:1
basex-modules/dba/src/main/resources/static/workspace.js has 884 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — basex-modules/dba/src/main/resources/static/workspace.js:1
basex-modules/dba/src/main/resources/static/databases.js has 422 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — basex-modules/dba/src/main/resources/static/databases.js:1
basex-api/src/main/javascript/BaseXClient.mjs has 415 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — basex-api/src/main/javascript/BaseXClient.mjs:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R7 · Dead Code5.5 / 10Adequate✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 11 application, 0 tooling and 0 test entry point(s) detected in this repo. This repository declares no build, type-check or test script, so nothing here would fail on a wrong deletion — confirm by hand that nothing loads each file (including by a path built at runtime) before removing it. An undetected custom entry would make these reachable.
no import path from any entry point (11 application, 0 tooling, 0 test roots considered), but 5 in-repo import(s) from 5 other file(s) do name it (basex-api/src/main/javascript/AddExample.mjs, basex-api/src/main/javascript/CreateExample.mjs, basex-api/src/main/javascript/Example.mjs and 2 more) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — basex-api/src/main/javascript/BaseXClient.mjs
no import path from any entry point (11 application, 0 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×5) — basex-api/src/main/javascript/AddExample.mjs, basex-api/src/main/javascript/QueryBindExample.mjs, basex-api/src/main/javascript/QueryExample.mjs, …
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
0/7 C# file(s) are in a nullable-enabled context. This repository commits no project file, so nothing sets <Nullable>enable</Nullable> for it: a file is enabled only by its own `#nullable enable`, by a Unity `csc.rsp` with `-nullable:enable` for its assembly, or as a file-based app (`#:` directives) whose `#:property Nullable` does not turn it off. NRTs catch a whole class of null-deref bugs at compile time.
What to do
Put every file in a nullable-enabled context — `#nullable enable` at its top, or commit a project file with <Nullable>enable</Nullable> — and resolve warnings rather than suppressing with `!`.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 12 of 55 WCAG 2.2 Level A/AA success criteria (22%; ≈24% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 43 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 1 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 74 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
AX1 Captive dependencies — no DI registrations detected
AX2 Stateful singletons — no singleton implementations detected
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — docker build failed (exit 1) — 11 | >>> && unzip -q /tmp/basex.zip -d /opt 12 | -------------------- ERROR: failed to solve: process "/bin/sh -c apk add --no-cache unzip && ZIP=\"BaseX$(echo \"${BASEX_VERSION}\" | tr -d '.').zip\" && wget -q \"https://files.basex.org/releases/${BASEX_VERSION}/${ZIP}\" -O /tmp/basex.zip && unzip -q /tmp/basex.zip -d /opt" did not complete successfully: exit code: 1; likely cause (the repository): a RUN step of the repository's REDACTED exited with code 1 (`/bin/sh -c apk add --no-cache unzip && ZIP=\"BaseX$(echo \"${BASEX_VERSION}\" | tr -d '.').zip\" && wget -q \"ht…`): the build's own command failed, for example a compile or test error; runtime evidence skipped The cause is in the repository, not in our sandbox: a RUN step of the repository's REDACTED exited with code 1 (`/bin/sh -c apk add --no-cache unzip && ZIP=\"BaseX$(echo \"${BASEX_VERSION}\" | tr -d '.').zip\" && wget -q \"ht…`): the build's own command failed, for example a compile or test error. Nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
D11 Test Reliability — Test reliability not included — the .java suite was found but not re-run
D12 Dependency Hygiene — Dependency currency not established — files.basex.org did not answer
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.
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"]`.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D30 Dependency Vulnerabilities — Scanner failed to run — not a clean result
D32 Data Compliance (PII/GDPR) — 13 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
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.
D43 Malicious Dependencies — Scanner failed to run — not a clean result
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 only 1 of the 3 signals this lens looks for (181 value object(s))
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 (this repository commits no MSBuild project, so its C# was read as syntax-only projects — a handler marked ONLY by an interface from a package is not visible without a build)
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
IC1 Incompleteness & stubs — IC1 reached only 0% of this repository's production lines — java (259,142 lines), javascript (4,919 lines), c (640 lines), php (508 lines), r (400 lines), python (383 lines), perl (326 lines), ruby (281 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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 measured — the application kind could not be determined for this repo
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 — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
PF2 Allocation hygiene — 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.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R4 Test Coverage — the JS/TS workspace (17 production file(s)) has no JavaScript/TypeScript test, but it is 1.87% of this repository's production source and the other 98.13% carries 90,876 line(s) of test code this pass cannot read — an incidental frontend's reachability is not the repository's test posture, so it is not scored as one
R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
R6 Tooling — no package.json in the repository — test/lint/typecheck wiring is read from package.json scripts (corroborated against CI), so this project's own toolchain isn't measured here
R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X12 Unreachable branch — X12 reached only 0% of this repository's production lines — java (259,142 lines), javascript (4,919 lines), c (640 lines), php (508 lines), r (400 lines), python (383 lines), perl (326 lines), ruby (281 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 0% of this repository's production lines — java (259,142 lines), javascript (4,919 lines), c (640 lines), php (508 lines), r (400 lines), python (383 lines), perl (326 lines), ruby (281 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — no async method does work a token could cancel
X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — X24 reached only 2% of this repository's production lines — java (259,142 lines), c (640 lines), php (508 lines), r (400 lines), python (383 lines), perl (326 lines), ruby (281 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X25 Inert configuration knob — 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
X27 Collection changed while being enumerated — This check needs a compiled C# program and this repository commits no project file to compile, so only its syntax could be read. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X3 Exception handling — X3 reached only 0% of this repository's production lines — java (259,142 lines), javascript (4,919 lines), c (640 lines), php (508 lines), r (400 lines), python (383 lines), perl (326 lines), ruby (281 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X30 Support guard that admits what it rejects — 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 — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X4 Structured logging — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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.
<html> without a lang basex-examples/src/main/resources/html/news.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC4 · Keyboard semantics· Click handler on a <span> nested inside <button> · ×1
Click handler on a <span> nested inside <button> basex-modules/dba/src/main/resources/static/workspace.js:146— This <span> carries its own click handler, but it sits inside a <button> that performs a different action. A keyboard user reaches the <button> and activating it runs the <button>'s handler, never this one, so this action has no keyboard path at all. Role and tabindex cannot supply one: HTML forbids a <button> from containing interactive content or any descendant with a tabindex, so the browser will not put this element in the tab order however it is marked up. Move it out of the <button> and make it a sibling <button>, so each action has its own control.
Orphaned knowledge basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Hotspot: basex-core/src/main/java/org/basex/query/QueryParser.java basex-core/src/main/java/org/basex/query/QueryParser.java:4848— basex-core/src/main/java/org/basex/query/QueryParser.java changed 74 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in QueryParser.ftMatchOption at line 4848. 35 of those changes were fix/bug commits, and the other 39 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/QueryParser.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/expr/SimpleMap.java basex-core/src/main/java/org/basex/query/expr/SimpleMap.java:120— basex-core/src/main/java/org/basex/query/expr/SimpleMap.java changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in SimpleMap.merge at line 120. 10 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/expr/SimpleMap.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/expr/path/Path.java basex-core/src/main/java/org/basex/query/expr/path/Path.java:520— basex-core/src/main/java/org/basex/query/expr/path/Path.java changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in Path.iterative at line 520. 13 of those changes were fix/bug commits, and the other 27 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/expr/path/Path.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/expr/CmpG.java basex-core/src/main/java/org/basex/query/expr/CmpG.java:59— basex-core/src/main/java/org/basex/query/expr/CmpG.java changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in CmpG.optimize at line 59. 12 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/expr/CmpG.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/gui/text/TextPanel.java basex-core/src/main/java/org/basex/gui/text/TextPanel.java:877— basex-core/src/main/java/org/basex/gui/text/TextPanel.java changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in TextPanel.keyPressed at line 877. 6 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/gui/text/TextPanel.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-modules/dba/src/main/resources/static/js.js basex-modules/dba/src/main/resources/static/js.js:1256— basex-modules/dba/src/main/resources/static/js.js changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in js.shortcuts at line 1256. 1 of those changes was a fix/bug commit, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-modules/dba/src/main/resources/static/js.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/data/MetaData.java basex-core/src/main/java/org/basex/data/MetaData.java:551— basex-core/src/main/java/org/basex/data/MetaData.java changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in MetaData.read at line 551. 4 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/data/MetaData.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/QueryError.java basex-core/src/main/java/org/basex/query/QueryError.java:1835— basex-core/src/main/java/org/basex/query/QueryError.java changed 58 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in QueryError.typeError at line 1835. 17 of those changes were fix/bug commits, and the other 41 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/QueryError.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/value/item/FuncItem.java basex-core/src/main/java/org/basex/query/value/item/FuncItem.java:374— basex-core/src/main/java/org/basex/query/value/item/FuncItem.java changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in FuncItem.fold at line 374. 10 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/value/item/FuncItem.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/expr/Filter.java basex-core/src/main/java/org/basex/query/expr/Filter.java:104— basex-core/src/main/java/org/basex/query/expr/Filter.java changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in Filter.optimize at line 104. 8 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/expr/Filter.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:747— basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in GFLWOR.optimizeCond at line 747. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/func/fn/FnLoadXQueryModule.java basex-core/src/main/java/org/basex/query/func/fn/FnLoadXQueryModule.java:42— basex-core/src/main/java/org/basex/query/func/fn/FnLoadXQueryModule.java changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in FnLoadXQueryModule.value at line 42. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/func/fn/FnLoadXQueryModule.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/value/map/XQMap.java basex-core/src/main/java/org/basex/query/value/map/XQMap.java:343— basex-core/src/main/java/org/basex/query/value/map/XQMap.java changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in XQMap.instanceOf at line 343. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/value/map/XQMap.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/value/type/SeqType.java basex-core/src/main/java/org/basex/query/value/type/SeqType.java:413— basex-core/src/main/java/org/basex/query/value/type/SeqType.java changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in SeqType.coerce at line 413. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/value/type/SeqType.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:915— basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in SyntaxXQuery.scan at line 915. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/value/type/ShapeType.java basex-core/src/main/java/org/basex/query/value/type/ShapeType.java:463— basex-core/src/main/java/org/basex/query/value/type/ShapeType.java changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in ShapeType.intersect at line 463. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/value/type/ShapeType.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/expr/path/Step.java basex-core/src/main/java/org/basex/query/expr/path/Step.java:332— basex-core/src/main/java/org/basex/query/expr/path/Step.java changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in Step.nodes at line 332. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/expr/path/Step.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/gui/text/TextRenderer.java basex-core/src/main/java/org/basex/gui/text/TextRenderer.java:790— basex-core/src/main/java/org/basex/gui/text/TextRenderer.java changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in TextRenderer.write at line 790. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/gui/text/TextRenderer.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/func/fn/FnSubsequence.java basex-core/src/main/java/org/basex/query/func/fn/FnSubsequence.java:276— basex-core/src/main/java/org/basex/query/func/fn/FnSubsequence.java changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in FnSubsequence.opt at line 276. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/func/fn/FnSubsequence.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/core/jobs/QueryJob.java basex-core/src/main/java/org/basex/core/jobs/QueryJob.java:245— basex-core/src/main/java/org/basex/core/jobs/QueryJob.java changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in QueryJob.run at line 245. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/core/jobs/QueryJob.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/expr/ft/FTWords.java basex-core/src/main/java/org/basex/query/expr/ft/FTWords.java:427— basex-core/src/main/java/org/basex/query/expr/ft/FTWords.java changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in FTWords.indexAccessible at line 427. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/expr/ft/FTWords.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-api/src/main/java/org/basex/http/restxq/RestXqFunction.java basex-api/src/main/java/org/basex/http/restxq/RestXqFunction.java:113— basex-api/src/main/java/org/basex/http/restxq/RestXqFunction.java changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in RestXqFunction.parseAnnotations at line 113. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-api/src/main/java/org/basex/http/restxq/RestXqFunction.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/util/options/Options.java basex-core/src/main/java/org/basex/util/options/Options.java:1074— basex-core/src/main/java/org/basex/util/options/Options.java changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in Options.assign at line 1074. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/util/options/Options.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/query/expr/Cmp.java basex-core/src/main/java/org/basex/query/expr/Cmp.java:246— basex-core/src/main/java/org/basex/query/expr/Cmp.java changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in Cmp.optBoolean at line 246. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/expr/Cmp.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: basex-core/src/main/java/org/basex/build/xml/XMLScanner.java basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:808— basex-core/src/main/java/org/basex/build/xml/XMLScanner.java changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in XMLScanner.markupDecl at line 808. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/build/xml/XMLScanner.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/value/node/DBNode.java basex-core/src/main/java/org/basex/query/value/node/DBNode.java:190— basex-core/src/main/java/org/basex/query/value/node/DBNode.java changed 14 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is DBNode.baseURI at line 190), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] Minor bug fixes”; “[MOD] Minor bug fixes and tweaks”; “[FIX] XQuery, RESTXQ: various bug fixes”; “[FIX] XQuery, HTTP, JSON: paths, modules, db nodes, limits”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/value/node/DBNode.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/StaticContext.java basex-core/src/main/java/org/basex/query/StaticContext.java:146— basex-core/src/main/java/org/basex/query/StaticContext.java changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is StaticContext.baseURI at line 146), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] XQuery: compare static contexts by value”; “[FIX] XQuery: static contexts, cyclic module imports”; “[FIX] XQuery: record extends, cyclic imports. qtspecs#2567”; “[FIX] XQuery, catalogs: schemes with digits, opaque URIs”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/StaticContext.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/up/expr/TransformWith.java basex-core/src/main/java/org/basex/query/up/expr/TransformWith.java:58— basex-core/src/main/java/org/basex/query/up/expr/TransformWith.java changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is TransformWith.value at line 58), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] XQUF: try/catch, transform, replace, %updating”; “[FIX] Minor bug fixes”; “[MOD] XQuery: cleanups, fixes, dead code removed”; “[FIX] XQuery: minor bug fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/up/expr/TransformWith.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/var/StaticVar.java basex-core/src/main/java/org/basex/query/var/StaticVar.java:51— basex-core/src/main/java/org/basex/query/var/StaticVar.java changed 13 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is StaticVar.compile at line 51), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[MOD] Minor bug fixes and tweaks”; “[FIX] XQuery: re-parseable optimized query strings”; “[FIX] XQuery: various bug fixes”; “[FIX] XQuery, function coercion qtspecs#1020”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/var/StaticVar.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/expr/Lookup.java basex-core/src/main/java/org/basex/query/expr/Lookup.java:110— basex-core/src/main/java/org/basex/query/expr/Lookup.java changed 13 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is Lookup.opt at line 110), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] Records, private declarations, map/array types”; “[MOD] XQuery: cleanups, fixes, dead code removed”; “[FIX] XQuery: coercion, atomized occurrences”; “[MIN] Javadoc: fix obvious errors”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/expr/Lookup.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/expr/ft/FTContains.java basex-core/src/main/java/org/basex/query/expr/ft/FTContains.java:47— basex-core/src/main/java/org/basex/query/expr/ft/FTContains.java changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is FTContains.value at line 47), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] Minor bug fixes”; “[MOD] XQuery: cleanups, fixes, dead code removed”; “[FIX] XQuery: re-parseable optimized query strings”; “[FIX] XQuery, full-text: database and default stop words”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/expr/ft/FTContains.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/func/fn/Docs.java basex-core/src/main/java/org/basex/query/func/fn/Docs.java:115— basex-core/src/main/java/org/basex/query/func/fn/Docs.java changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is Docs.check at line 115), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[MOD] Security-related fixes and cleanups”; “[FIX] XQuery: closures, compile-time database access”; “[FIX] XQuery: lock DEFAULTDB database (c05664d957)”; “[FIX] XML parsing: trust-external, external DTDs, catalogs”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/func/fn/Docs.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java:212— basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is AdaptiveSerializer.array at line 212), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] Minor bug fixes”; “[FIX] XQuery: re-parseable optimized query strings”; “[FIX] JNodes: axes, fn:innermost, maps, adaptive output”; “[FIX] Serialization: character maps for strings only”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/var/Var.java basex-core/src/main/java/org/basex/query/var/Var.java:187— basex-core/src/main/java/org/basex/query/var/Var.java changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is Var.refineType at line 187), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] XQuery: re-parseable optimized query strings”; “[FIX] XQuery: coercion, atomized occurrences”; “[FIX] XQuery, function coercion qtspecs#1020”; “[FIX] XQuery, records: field order and subtyping”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/var/Var.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/value/type/MapType.java basex-core/src/main/java/org/basex/query/value/type/MapType.java:145— basex-core/src/main/java/org/basex/query/value/type/MapType.java changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is MapType.intersect at line 145), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] Records, private declarations, map/array types”; “[MOD] XQuery: cleanups, fixes, dead code removed”; “[FIX] XQuery: type intersection, choice coercion”; “[FIX] XQuery: coercion, atomized occurrences”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/value/type/MapType.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/func/fn/FnData.java basex-core/src/main/java/org/basex/query/func/fn/FnData.java:30— basex-core/src/main/java/org/basex/query/func/fn/FnData.java changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is FnData.opt at line 30), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] XQuery: fn:data, empty context value”; “[MOD] XQuery: cleanups, fixes, dead code removed”; “[FIX] XQuery, paths: index rewrite, context helpers”; “[FIX] XQuery: coercion, atomized occurrences”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/func/fn/FnData.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/core/Databases.java basex-core/src/main/java/org/basex/core/Databases.java:83— basex-core/src/main/java/org/basex/core/Databases.java changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is Databases.list at line 83), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[MOD] Security-related fixes and cleanups”; “[MIN] Javadoc: fix obvious errors”; “[FIX] Core: only list ZIP files with date as backups”; “[FIX] I/O: data-loss fixes, links, File Module cleanups”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/core/Databases.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/core/jobs/JobPool.java basex-core/src/main/java/org/basex/core/jobs/JobPool.java:328— basex-core/src/main/java/org/basex/core/jobs/JobPool.java changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is JobPool.ids at line 328), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[MOD] Minor bug fixes and tweaks”; “[MIN] Javadoc: fix obvious errors”; “[FIX] Jobs: remove repeating tasks, wait on close”; “[FIX] Jobs: stoppable I/O, run slots, pool shutdown”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/core/jobs/JobPool.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/expr/gflwor/For.java basex-core/src/main/java/org/basex/query/expr/gflwor/For.java:67— basex-core/src/main/java/org/basex/query/expr/gflwor/For.java changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is 1.next at line 67), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] XQuery, FLWOR: sliding while clauses”; “[FIX] XQuery: re-parseable optimized query strings”; “[FIX] XQuery: coercion, atomized occurrences”; “[MIN] Javadoc: fix obvious errors”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/expr/gflwor/For.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: REDACTED REDACTED:88— REDACTED changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is ClientSession.<init> at line 88), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[MOD] Security-related fixes and cleanups”; “[FIX] Client: pre-13.0 server login message”; “[FIX] HTTP, client API: buffer streamed request bodies”; “[FIX] Client: clear error for pre-13.0 servers”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/up/DataUpdates.java basex-core/src/main/java/org/basex/query/up/DataUpdates.java:155— basex-core/src/main/java/org/basex/query/up/DataUpdates.java changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is DataUpdates.prepare at line 155), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] XQUF: try/catch, transform, replace, %updating”; “[FIX] XQuery, updates: write back databases opened in context”; “[MOD] Minor bug fixes and tweaks”; “[MIN] Javadoc: fix obvious errors”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/up/DataUpdates.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/QueryString.java basex-core/src/main/java/org/basex/query/QueryString.java:411— basex-core/src/main/java/org/basex/query/QueryString.java changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is QueryString.toContent at line 411), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[MOD] XQuery: cleanups, fixes, dead code removed”; “[FIX] XQuery, RESTXQ: various bug fixes”; “[FIX] XQuery: re-parseable optimized query strings”; “[MIN] Javadoc: fix obvious errors”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/QueryString.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/up/expr/Transform.java basex-core/src/main/java/org/basex/query/up/expr/Transform.java:70— basex-core/src/main/java/org/basex/query/up/expr/Transform.java changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is Transform.value at line 70), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] XQuery: minor bug fixes”; “[FIX] XQuery: re-parseable optimized query strings”; “[FIX] XQuery Update: copy namespace nodes”; “[FIX] XQuery Update: copy-namespaces no-preserve”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/up/expr/Transform.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/up/expr/Copy.java basex-core/src/main/java/org/basex/query/up/expr/Copy.java:52— basex-core/src/main/java/org/basex/query/up/expr/Copy.java changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is Copy.copy at line 52), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] XQuery: static contexts, cyclic module imports”; “[MIN] Javadoc: fix obvious errors”; “[FIX] XQuery Update: copy namespace nodes”; “[FIX] XQuery Update: copy-namespaces no-preserve”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/up/expr/Copy.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/value/type/ArrayType.java basex-core/src/main/java/org/basex/query/value/type/ArrayType.java:87— basex-core/src/main/java/org/basex/query/value/type/ArrayType.java changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is ArrayType.instanceOf at line 87), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] Records, private declarations, map/array types”; “[FIX] XQuery: type intersection, choice coercion”; “[FIX] XQuery: coercion, atomized occurrences”; “[FIX] XQuery: various bug fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/value/type/ArrayType.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/util/ft/FTOpt.java basex-core/src/main/java/org/basex/util/ft/FTOpt.java:143— basex-core/src/main/java/org/basex/util/ft/FTOpt.java changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is FTOpt.toString at line 143), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[MOD] Util: cleanups, fixes, dead code removed”; “[FIX] XQuery: re-parseable optimized query strings”; “[FIX] XQuery, full-text: database and default stop words”; “[FIX] Full-text: spec conformance, index, options”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/util/ft/FTOpt.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/expr/ASwitch.java basex-core/src/main/java/org/basex/query/expr/ASwitch.java:182— basex-core/src/main/java/org/basex/query/expr/ASwitch.java changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is ASwitch.equals at line 182), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] XQuery: compare static contexts by value”; “[FIX] XQuery: static contexts, cyclic module imports”; “[FIX] XQuery, switch, typeswitch: rewrites, static types”; “[FIX] XQuery: simplified operands, stale parent types”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/expr/ASwitch.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/up/primitives/node/NodeCopy.java basex-core/src/main/java/org/basex/query/up/primitives/node/NodeCopy.java:90— basex-core/src/main/java/org/basex/query/up/primitives/node/NodeCopy.java changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is NodeCopy.mergeNodeCacheText at line 90), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[FIX] XQUF: try/catch, transform, replace, %updating”; “[MOD] XQuery: cleanups, fixes, dead code removed”; “[FIX] Core, namespaces: limits, resolution, performance”; “[FIX] XQuery, updates: namespaces, lazy replace”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/up/primitives/node/NodeCopy.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/util/pkg/ModuleLoader.java basex-core/src/main/java/org/basex/query/util/pkg/ModuleLoader.java:77— basex-core/src/main/java/org/basex/query/util/pkg/ModuleLoader.java changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is ModuleLoader.addImport at line 77), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[MOD] XQuery: cleanups, fixes, dead code removed”; “[MOD] Security-related fixes and cleanups”; “[MIN] Javadoc: fix obvious errors”; “[FIX] Options: resolve path options consistently”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/util/pkg/ModuleLoader.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: basex-core/src/main/java/org/basex/query/QueryException.java basex-core/src/main/java/org/basex/query/QueryException.java:360— basex-core/src/main/java/org/basex/query/QueryException.java changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is QueryException.values at line 360), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[MOD] XQuery: cleanups, fixes, dead code removed”; “[FIX] XQuery: type intersection, choice coercion”; “[MIN] Javadoc: fix obvious errors”; “[FIX] XQuery, fork-join: nested pools, errors, fork-any”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 13:50:44 +01:00' --until='2026-11-16 13:50:44 +01:00' --full-history --no-merges -- basex-core/src/main/java/org/basex/query/QueryException.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
TooManyMethods: QueryParser basex-core/src/main/java/org/basex/query/QueryParser.java:56— TooManyMethods — 225 methods. The bar is 30 methods; this is 195 over it, 7.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TextEditor basex-core/src/main/java/org/basex/gui/text/TextEditor.java:20— TooManyMethods — 129 methods. The bar is 30 methods; this is 99 over it, 4.30× 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: ParseExpr basex-core/src/main/java/org/basex/query/expr/ParseExpr.java:34— TooManyMethods — 97 methods. The bar is 30 methods; this is 67 over it, 3.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Token basex-core/src/main/java/org/basex/util/Token.java:25— TooManyMethods — 93 methods. The bar is 30 methods; this is 63 over it, 3.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TextPanel basex-core/src/main/java/org/basex/gui/text/TextPanel.java:32— TooManyMethods — 92 methods. The bar is 30 methods; this is 62 over it, 3.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: StandardFunc basex-core/src/main/java/org/basex/query/func/StandardFunc.java:49— TooManyMethods — 91 methods. The bar is 30 methods; this is 61 over it, 3.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Data basex-core/src/main/java/org/basex/data/Data.java:71— TooManyMethods — 78 methods. The bar is 30 methods; this is 48 over it, 2.60× 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: IOFile basex-core/src/main/java/org/basex/io/IOFile.java:24— TooManyMethods — 74 methods. The bar is 30 methods; this is 44 over it, 2.47× 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: Options basex-core/src/main/java/org/basex/util/options/Options.java:36— TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TextRenderer basex-core/src/main/java/org/basex/gui/text/TextRenderer.java:19— TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.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.
TooManyMethods: Syntax basex-core/src/main/java/org/basex/gui/text/Syntax.java:19— TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GFLWOR basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:31— TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Expr basex-core/src/main/java/org/basex/query/expr/Expr.java:33— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorView basex-core/src/main/java/org/basex/gui/view/editor/EditorView.java:49— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× 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: Sandbox basex-core/src/main/java/org/basex/core/Sandbox.java:37— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: SeqType basex-core/src/main/java/org/basex/query/value/type/SeqType.java:25— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: SyntaxXQuery basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:34— TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: QueryContext basex-core/src/main/java/org/basex/query/QueryContext.java:60— TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: XMLScanner basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:28— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× 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: Serializer basex-core/src/main/java/org/basex/io/serial/Serializer.java:31— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× 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: QNm basex-core/src/main/java/org/basex/query/value/item/QNm.java:27— TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× 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: BXNode basex-core/src/main/java/org/basex/api/dom/BXNode.java:20— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× 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: Path basex-core/src/main/java/org/basex/query/expr/path/Path.java:36— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× 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: ADate basex-core/src/main/java/org/basex/query/value/item/ADate.java:25— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× 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: Namespaces basex-core/src/main/java/org/basex/data/Namespaces.java:26— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
+ 37 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×30
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Unfold.java:508— basex-core/src/main/java/org/basex/query/expr/Unfold.java:508-512 | basex-core/src/main/java/org/basex/query/expr/Recur.java:136-139 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnLocalNameFromQName.java:19— basex-core/src/main/java/org/basex/query/func/fn/FnLocalNameFromQName.java:19-22 | basex-core/src/main/java/org/basex/query/func/fn/FnPrefixFromQName.java:19-23 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/expr/ShapeGet.java:79— basex-core/src/main/java/org/basex/query/expr/ShapeGet.java:79-82 | basex-core/src/main/java/org/basex/query/expr/ShapeSet.java:74-77 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/io/out/PrintOutput.java:106— basex-core/src/main/java/org/basex/io/out/PrintOutput.java:106-109 | basex-core/src/main/java/org/basex/io/serial/StandardSerializer.java:116-119 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/expr/List.java:43— basex-core/src/main/java/org/basex/query/expr/List.java:43-46 | basex-core/src/main/java/org/basex/query/expr/SimpleMap.java:52-55 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnLowerCase.java:17— basex-core/src/main/java/org/basex/query/func/fn/FnLowerCase.java:17-20 | basex-core/src/main/java/org/basex/query/func/fn/FnUpperCase.java:17-20 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnUnparsedBinary.java:22— basex-core/src/main/java/org/basex/query/func/fn/FnUnparsedBinary.java:22-26 | basex-core/src/main/java/org/basex/query/func/fn/ParseHtml.java:34-37 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/api/dom/BXAttr.java:29— basex-core/src/main/java/org/basex/api/dom/BXAttr.java:29-32 | basex-core/src/main/java/org/basex/api/dom/BXElem.java:28-31 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnExpandedQName.java:18— basex-core/src/main/java/org/basex/query/func/fn/FnExpandedQName.java:18-21 | basex-core/src/main/java/org/basex/query/func/fn/FnNamespaceUriFromQName.java:18-21 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/value/map/XQItemValueMap.java:65— basex-core/src/main/java/org/basex/query/value/map/XQItemValueMap.java:65-68 | basex-core/src/main/java/org/basex/query/value/map/XQMap.java:314-317 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/api/dom/BXAttr.java:45— basex-core/src/main/java/org/basex/api/dom/BXAttr.java:45-48 | basex-core/src/main/java/org/basex/api/dom/BXElem.java:45-48 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/core/cmd/AlterPassword.java:42— basex-core/src/main/java/org/basex/core/cmd/AlterPassword.java:42-45 | basex-core/src/main/java/org/basex/core/cmd/CreateUser.java:40-43 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/expr/index/RangeAccess.java:38— basex-core/src/main/java/org/basex/query/expr/index/RangeAccess.java:38-41 | basex-core/src/main/java/org/basex/query/expr/index/StringRangeAccess.java:38-41 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/func/inspect/InspectModule.java:20— basex-core/src/main/java/org/basex/query/func/inspect/InspectModule.java:20-23 | basex-core/src/main/java/org/basex/query/func/inspect/InspectXqdoc.java:20-23 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/func/file/FileReadTextLines.java:104— basex-core/src/main/java/org/basex/query/func/file/FileReadTextLines.java:104-109 | basex-core/src/main/java/org/basex/util/Util.java:371-374 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnSubsequence.java:188— basex-core/src/main/java/org/basex/query/func/fn/FnSubsequence.java:188-191 | basex-core/src/main/java/org/basex/query/func/util/UtilCountWithin.java:151-154 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/up/primitives/node/InsertInto.java:28— basex-core/src/main/java/org/basex/query/up/primitives/node/InsertInto.java:28-31 | basex-core/src/main/java/org/basex/query/up/primitives/node/InsertIntoAsLast.java:29-32 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/value/item/Dbl.java:81— basex-core/src/main/java/org/basex/query/value/item/Dbl.java:81-84 | basex-core/src/main/java/org/basex/query/value/item/Flt.java:81-84 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/core/StaticOptions.java:111— basex-core/src/main/java/org/basex/core/StaticOptions.java:111-114 | basex-core/src/main/java/org/basex/util/http/AuthScheme.java:16-19 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Extension.java:114— basex-core/src/main/java/org/basex/query/expr/Extension.java:114-117 | basex-core/src/main/java/org/basex/query/expr/ft/FTExtension.java:48-51 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/value/type/ArrayType.java:67— basex-core/src/main/java/org/basex/query/value/type/ArrayType.java:67-70 | basex-core/src/main/java/org/basex/query/value/type/MapType.java:89-92 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/core/BaseXException.java:40— basex-core/src/main/java/org/basex/core/BaseXException.java:40-43 | basex-core/src/main/java/org/basex/query/QueryException.java:128-131 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/gui/text/SearchBar.java:386— basex-core/src/main/java/org/basex/gui/text/SearchBar.java:386-389 | basex-core/src/main/java/org/basex/gui/view/project/ProjectFilter.java:257-260 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/expr/CmpG.java:569— basex-core/src/main/java/org/basex/query/expr/CmpG.java:569-573 | basex-core/src/main/java/org/basex/query/expr/Instance.java:97-100 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnCeiling.java:16— basex-core/src/main/java/org/basex/query/func/fn/FnCeiling.java:16-19 | basex-core/src/main/java/org/basex/query/func/fn/FnFloor.java:16-19 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
ClassTooLong: QueryParser basex-core/src/main/java/org/basex/query/QueryParser.java:56— ClassTooLong — 3119 significant lines (blank, comment-only and punctuation-only lines excluded), 225 methods. The bar is 400 significant lines; this is 2719 over it, 7.80× 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: Function basex-core/src/main/java/org/basex/query/func/Function.java:65— ClassTooLong — 1449 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 1049 over it, 3.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: TextEditor basex-core/src/main/java/org/basex/gui/text/TextEditor.java:20— ClassTooLong — 1104 significant lines (blank, comment-only and punctuation-only lines excluded), 129 methods. The bar is 400 significant lines; this is 704 over it, 2.76× 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: QueryError basex-core/src/main/java/org/basex/query/QueryError.java:26— ClassTooLong — 877 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 477 over it, 2.19× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TextPanel basex-core/src/main/java/org/basex/gui/text/TextPanel.java:32— ClassTooLong — 821 significant lines (blank, comment-only and punctuation-only lines excluded), 92 methods. The bar is 400 significant lines; this is 421 over it, 2.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SyntaxXQuery basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:34— ClassTooLong — 777 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods. The bar is 400 significant lines; this is 377 over it, 1.94× 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: Text basex-core/src/main/java/org/basex/core/Text.java:24— ClassTooLong — 746 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 346 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GreekStemmer basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:14— ClassTooLong — 735 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 335 over it, 1.84× 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: GFLWOR basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:31— ClassTooLong — 719 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 319 over it, 1.80× 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: Token basex-core/src/main/java/org/basex/util/Token.java:25— ClassTooLong — 654 significant lines (blank, comment-only and punctuation-only lines excluded), 93 methods. The bar is 400 significant lines; this is 254 over it, 1.64× 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: EditorView basex-core/src/main/java/org/basex/gui/view/editor/EditorView.java:49— ClassTooLong — 640 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods. The bar is 400 significant lines; this is 240 over it, 1.60× 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: BasicType basex-core/src/main/java/org/basex/query/value/type/BasicType.java:29— ClassTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 225 over it, 1.56× 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: XMLScanner basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:28— ClassTooLong — 615 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 215 over it, 1.54× 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: TreeView basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:29— ClassTooLong — 615 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 215 over it, 1.54× 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: PlotView basex-core/src/main/java/org/basex/gui/view/plot/PlotView.java:28— ClassTooLong — 612 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 212 over it, 1.53× 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: TextRenderer basex-core/src/main/java/org/basex/gui/text/TextRenderer.java:19— ClassTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded), 65 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: Path basex-core/src/main/java/org/basex/query/expr/path/Path.java:36— ClassTooLong — 561 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 161 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Options basex-core/src/main/java/org/basex/util/options/Options.java:36— ClassTooLong — 543 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods. The bar is 400 significant lines; this is 143 over it, 1.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Data basex-core/src/main/java/org/basex/data/Data.java:71— ClassTooLong — 523 significant lines (blank, comment-only and punctuation-only lines excluded), 78 methods. The bar is 400 significant lines; this is 123 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: StandardFunc basex-core/src/main/java/org/basex/query/func/StandardFunc.java:49— ClassTooLong — 508 significant lines (blank, comment-only and punctuation-only lines excluded), 91 methods. The bar is 400 significant lines; this is 108 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DeepTree basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:16— ClassTooLong — 500 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 100 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GUIMenuCmd basex-core/src/main/java/org/basex/gui/GUIMenuCmd.java:30— ClassTooLong — 451 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 51 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TableDiskAccess basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:23— ClassTooLong — 445 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 45 over it, 1.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MapRenderer basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:23— ClassTooLong — 428 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 28 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: IOFile basex-core/src/main/java/org/basex/io/IOFile.java:24— ClassTooLong — 420 significant lines (blank, comment-only and punctuation-only lines excluded), 74 methods. The bar is 400 significant lines; this is 20 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
+ 1 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×25
Edited copy of a member (7 corresponding lines) basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:141— basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:141-147 | basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:223-229 — 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) basex-core/src/main/java/org/basex/query/expr/Recur.java:106— basex-core/src/main/java/org/basex/query/expr/Recur.java:106-112 | basex-core/src/main/java/org/basex/query/expr/Unfold.java:487-494 — 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) basex-core/src/main/java/org/basex/query/func/cache/CacheGetOrPut.java:16— basex-core/src/main/java/org/basex/query/func/cache/CacheGetOrPut.java:16-22 | basex-core/src/main/java/org/basex/query/func/store/StoreGetOrPut.java:16-27 — 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) basex-core/src/main/java/org/basex/gui/view/map/MapView.java:484— basex-core/src/main/java/org/basex/gui/view/map/MapView.java:484-494 | basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:1066-1072 — 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) basex-core/src/main/java/org/basex/query/expr/index/RangeAccess.java:60— basex-core/src/main/java/org/basex/query/expr/index/RangeAccess.java:60-66 | basex-core/src/main/java/org/basex/query/expr/index/StringRangeAccess.java:60-66 — 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) basex-core/src/main/java/org/basex/query/expr/gflwor/Condition.java:241— basex-core/src/main/java/org/basex/query/expr/gflwor/Condition.java:241-248 | basex-core/src/main/java/org/basex/query/expr/gflwor/For.java:267-273 — 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) basex-core/src/main/java/org/basex/query/expr/CmpSimpleG.java:29— basex-core/src/main/java/org/basex/query/expr/CmpSimpleG.java:29-35 | basex-core/src/main/java/org/basex/query/expr/CmpV.java:102-108 — 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) basex-core/src/main/java/org/basex/query/func/file/FileReadText.java:21— basex-core/src/main/java/org/basex/query/func/file/FileReadText.java:21-29 | basex-core/src/main/java/org/basex/query/func/file/FileReadTextLines.java:76-82 — 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) basex-core/src/main/java/org/basex/io/random/DataAccess.java:396— basex-core/src/main/java/org/basex/io/random/DataAccess.java:396-402 | basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:471-477 — 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) basex-core/src/main/java/org/basex/query/expr/Mapping.java:102— basex-core/src/main/java/org/basex/query/expr/Mapping.java:102-108 | basex-core/src/main/java/org/basex/query/up/expr/TransformWith.java:96-103 — 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) basex-core/src/main/java/org/basex/query/expr/ft/FTContains.java:129— basex-core/src/main/java/org/basex/query/expr/ft/FTContains.java:129-135 | basex-core/src/main/java/org/basex/query/expr/ft/FTIndexAccess.java:90-96 — 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) basex-core/src/main/java/org/basex/query/up/primitives/db/DBPut.java:56— basex-core/src/main/java/org/basex/query/up/primitives/db/DBPut.java:56-62 | basex-core/src/main/java/org/basex/query/up/primitives/db/DBPutBinary.java:57-63 — 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) basex-api/src/main/java/org/basex/query/func/request/RequestAttributeMap.java:18— basex-api/src/main/java/org/basex/query/func/request/RequestAttributeMap.java:18-24 | basex-api/src/main/java/org/basex/query/func/request/RequestAttributeNames.java:19-25 — 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) basex-core/src/main/java/org/basex/query/expr/CmpN.java:48— basex-core/src/main/java/org/basex/query/expr/CmpN.java:48-54 | basex-core/src/main/java/org/basex/query/expr/CmpN.java:57-63 — 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) basex-core/src/main/java/org/basex/query/func/StaticFuncs.java:411— basex-core/src/main/java/org/basex/query/func/StaticFuncs.java:411-417 | basex-core/src/main/java/org/basex/query/var/Variables.java:258-264 — 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) basex-core/src/main/java/org/basex/query/func/convert/ConvertDecodeKey.java:18— basex-core/src/main/java/org/basex/query/func/convert/ConvertDecodeKey.java:18-25 | basex-core/src/main/java/org/basex/query/func/convert/ConvertEncodeKey.java:16-22 — 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) basex-core/src/main/java/org/basex/query/value/seq/Seq.java:137— basex-core/src/main/java/org/basex/query/value/seq/Seq.java:137-143 | basex-core/src/main/java/org/basex/query/value/seq/Seq.java:146-157 — 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) basex-core/src/main/java/org/basex/query/expr/Arr.java:90— basex-core/src/main/java/org/basex/query/expr/Arr.java:90-96 | basex-core/src/main/java/org/basex/query/value/map/XQShapeMap.java:135-142 — 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) basex-core/src/main/java/org/basex/query/func/index/IndexFacets.java:71— basex-core/src/main/java/org/basex/query/func/index/IndexFacets.java:71-78 | basex-core/src/main/java/org/basex/query/up/NameLimits.java:132-138 — 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) basex-core/src/main/java/org/basex/io/serial/HTMLSerializer.java:161— basex-core/src/main/java/org/basex/io/serial/HTMLSerializer.java:161-167 | basex-core/src/main/java/org/basex/io/serial/XHTMLSerializer.java:70-76 — 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) basex-core/src/main/java/org/basex/query/func/map/MapEntries.java:32— basex-core/src/main/java/org/basex/query/func/map/MapEntries.java:32-38 | basex-core/src/main/java/org/basex/query/func/map/MapKeys.java:21-27 — 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) basex-core/src/main/java/org/basex/query/util/regex/Escape.java:54— basex-core/src/main/java/org/basex/query/util/regex/Escape.java:54-60 | basex-core/src/main/java/org/basex/query/util/regex/Escape.java:102-108 — 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) basex-core/src/main/java/org/basex/query/func/cache/CacheGet.java:15— basex-core/src/main/java/org/basex/query/func/cache/CacheGet.java:15-21 | basex-core/src/main/java/org/basex/query/func/cache/CacheRemove.java:14-20 — 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) basex-core/src/main/java/org/basex/util/list/IntList.java:152— basex-core/src/main/java/org/basex/util/list/IntList.java:152-158 | basex-core/src/main/java/org/basex/util/list/ObjectList.java:177-183 — 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) basex-core/src/main/java/org/basex/api/client/LocalSession.java:123— basex-core/src/main/java/org/basex/api/client/LocalSession.java:123-129 | basex-core/src/main/java/org/basex/server/ServerQuery.java:72-78 — 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.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/core/cmd/Add.java:91— basex-core/src/main/java/org/basex/core/cmd/Add.java:91-96 | basex-core/src/main/java/org/basex/query/func/db/DbNew.java:126-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/expr/Intersect.java:60— basex-core/src/main/java/org/basex/query/expr/Intersect.java:60-65 | basex-core/src/main/java/org/basex/query/expr/Union.java:53-58 — 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 `basex-core/src/main/java/org/basex/query/expr/Intersect.java:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/func/db/DbContentType.java:29— basex-core/src/main/java/org/basex/query/func/db/DbContentType.java:29-34 | basex-core/src/main/java/org/basex/query/func/db/DbType.java:25-30 — 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 `basex-core/src/main/java/org/basex/query/func/db/DbContentType.java:29` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/func/fn/FnFilter.java:22— basex-core/src/main/java/org/basex/query/func/fn/FnFilter.java:22-27 | basex-core/src/main/java/org/basex/query/func/fn/FnIndexWhere.java:22-27 — 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 `basex-core/src/main/java/org/basex/query/func/fn/FnFilter.java:22` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/func/fn/FnTokenize.java:32— basex-core/src/main/java/org/basex/query/func/fn/FnTokenize.java:32-37 | basex-core/src/main/java/org/basex/query/func/fn/FnTokenize.java:87-92 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:322— basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:322-327 | basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:370-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:322` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:149— basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:149-154 | basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:171-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:149` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/util/list/BoolList.java:83— basex-core/src/main/java/org/basex/util/list/BoolList.java:83-88 | basex-core/src/main/java/org/basex/util/list/IntList.java:93-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/core/cmd/Dir.java:61— basex-core/src/main/java/org/basex/core/cmd/Dir.java:61-66 | basex-core/src/main/java/org/basex/query/func/db/DbDir.java:50-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/core/cmd/Dir.java:61` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:168— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:168-173 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:168-173 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:168` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) basex-core/src/main/java/org/basex/io/out/DataOutput.java:201— basex-core/src/main/java/org/basex/io/out/DataOutput.java:201-206 | basex-core/src/main/java/org/basex/io/random/DataAccess.java:758-763 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/expr/Single.java:67— basex-core/src/main/java/org/basex/query/expr/Single.java:67-72 | basex-core/src/main/java/org/basex/query/expr/gflwor/SingleClause.java:54-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/func/fn/FnTail.java:56— basex-core/src/main/java/org/basex/query/func/fn/FnTail.java:56-61 | basex-core/src/main/java/org/basex/query/func/fn/FnTrunk.java:73-78 — 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) basex-core/src/main/java/org/basex/io/serial/Serializer.java:369— basex-core/src/main/java/org/basex/io/serial/Serializer.java:369-374 | basex-core/src/main/java/org/basex/query/util/NSContext.java:54-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/func/array/ArrayEmpty.java:27— basex-core/src/main/java/org/basex/query/func/array/ArrayEmpty.java:27-32 | basex-core/src/main/java/org/basex/query/func/map/MapEmpty.java:26-31 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/func/array/ArraySize.java:23— basex-core/src/main/java/org/basex/query/func/array/ArraySize.java:23-28 | basex-core/src/main/java/org/basex/query/func/map/MapSize.java:23-28 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/func/csv/CsvSerialize.java:46— basex-core/src/main/java/org/basex/query/func/csv/CsvSerialize.java:46-51 | basex-core/src/main/java/org/basex/query/func/json/JsonSerialize.java:46-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:377— basex-core/src/main/java/org/basex/query/value/array/BigArray.java:377-382 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:371-376 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/BigArray.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `merged` to `Value[]` in one and `Item[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:34— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:34-39 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:34-39 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/value/item/Dat.java:58— basex-core/src/main/java/org/basex/query/value/item/Dat.java:58-63 | basex-core/src/main/java/org/basex/query/value/item/Tim.java:54-59 — 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) basex-core/src/main/java/org/basex/io/in/DataInput.java:98— basex-core/src/main/java/org/basex/io/in/DataInput.java:98-103 | basex-core/src/main/java/org/basex/io/random/DataAccess.java:595-600 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `basex-core/src/main/java/org/basex/io/in/DataInput.java:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/func/fn/FnGraphemes.java:29— basex-core/src/main/java/org/basex/query/func/fn/FnGraphemes.java:29-34 | basex-core/src/main/java/org/basex/util/Icu.java:23-28 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `basex-core/src/main/java/org/basex/query/func/fn/FnGraphemes.java:29` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:117— basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:117-122 | basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:134-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) basex-examples/src/main/java/org/basex/examples/rest/RESTGet.java:36— basex-examples/src/main/java/org/basex/examples/rest/RESTGet.java:36-41 | basex-examples/src/main/java/org/basex/examples/rest/RESTPost.java:43-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `basex-examples/src/main/java/org/basex/examples/rest/RESTGet.java:36` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/gui/dialog/DialogCsvParser.java:83— basex-core/src/main/java/org/basex/gui/dialog/DialogCsvParser.java:83-87 | basex-core/src/main/java/org/basex/gui/dialog/DialogJsonParser.java:108-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `basex-core/src/main/java/org/basex/gui/dialog/DialogCsvParser.java:89` calls `add`, `BaseXLabel` and `basex-core/src/main/java/org/basex/gui/dialog/DialogJsonParser.java:114` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:300— basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:300-304 | basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:318-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:300` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/gui/view/map/SquarifiedAlgo.java:26— basex-core/src/main/java/org/basex/gui/view/map/SquarifiedAlgo.java:26-30 | basex-core/src/main/java/org/basex/gui/view/map/StripAlgo.java:27-31 — 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 `basex-core/src/main/java/org/basex/gui/view/map/SquarifiedAlgo.java:26` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/io/out/DataOutput.java:215— basex-core/src/main/java/org/basex/io/out/DataOutput.java:215-219 | basex-core/src/main/java/org/basex/io/out/DataOutput.java:231-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/io/out/DataOutput.java:215` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/io/random/DataAccess.java:410— basex-core/src/main/java/org/basex/io/random/DataAccess.java:410-414 | basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:485-489 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/io/random/DataAccess.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. 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) basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:226— basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:226-230 | basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:239-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:226` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `int` in one and `long` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/query/func/array/ArrayFilter.java:33— basex-core/src/main/java/org/basex/query/func/array/ArrayFilter.java:33-37 | basex-core/src/main/java/org/basex/query/func/array/ArrayForEach.java:33-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/func/array/ArrayFilter.java:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) basex-core/src/main/java/org/basex/query/func/bin/BinFn.java:114— basex-core/src/main/java/org/basex/query/func/bin/BinFn.java:114-118 | basex-core/src/main/java/org/basex/query/func/bin/BinPart.java:20-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) basex-core/src/main/java/org/basex/query/func/db/DbAlterBackup.java:27— basex-core/src/main/java/org/basex/query/func/db/DbAlterBackup.java:27-31 | basex-core/src/main/java/org/basex/query/func/db/DbDropBackup.java:24-28 — 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 `basex-core/src/main/java/org/basex/query/func/db/DbAlterBackup.java:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/query/util/collation/BaseXCollation.java:45— basex-core/src/main/java/org/basex/query/util/collation/BaseXCollation.java:45-49 | basex-core/src/main/java/org/basex/query/util/collation/UCACollation.java:74-78 — 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 `basex-core/src/main/java/org/basex/query/util/collation/BaseXCollation.java:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/query/value/seq/DBNodes.java:143— basex-core/src/main/java/org/basex/query/value/seq/DBNodes.java:143-147 | basex-core/src/main/java/org/basex/query/value/seq/DBNodes.java:164-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/seq/DBNodes.java:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/util/list/IntList.java:491— basex-core/src/main/java/org/basex/util/list/IntList.java:491-495 | basex-core/src/main/java/org/basex/util/list/IntList.java:552-556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/util/list/IntList.java:491` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `values` to `double[]` in one and `int[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoEndPoint.java:19— basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoEndPoint.java:19-23 | basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoStartPoint.java:19-23 — before extracting anything, compare `basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoEndPoint.java` and `basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoStartPoint.java` as WHOLE FILES: 90% 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.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/query/func/array/ArrayFoot.java:24— basex-core/src/main/java/org/basex/query/func/array/ArrayFoot.java:24-28 | basex-core/src/main/java/org/basex/query/func/array/ArrayHead.java:24-28 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/func/array/ArrayFoot.java` and `basex-core/src/main/java/org/basex/query/func/array/ArrayHead.java` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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) basex-core/src/main/java/org/basex/query/expr/index/RangeAccess.java:84— basex-core/src/main/java/org/basex/query/expr/index/RangeAccess.java:84-88 | basex-core/src/main/java/org/basex/query/expr/index/StringRangeAccess.java:120-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/query/func/store/StoreClose.java:14— basex-core/src/main/java/org/basex/query/func/store/StoreClose.java:14-19 | basex-core/src/main/java/org/basex/query/func/store/StoreWrite.java:14-18 — 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 (5 lines × 2) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:96— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:96-100 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:96-100 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `val` to `Value` in one and `Item` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/query/value/array/SmallArray.java:69— basex-core/src/main/java/org/basex/query/value/array/SmallArray.java:69-73 | basex-core/src/main/java/org/basex/query/value/seq/tree/SmallSeq.java:92-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:143— basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:143-147 | basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:225-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:143` 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 (5 lines × 2) basex-core/src/main/java/org/basex/query/func/job/JobBindings.java:23— basex-core/src/main/java/org/basex/query/func/job/JobBindings.java:23-27 | basex-core/src/main/java/org/basex/query/func/job/JobListDetails.java:32-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:450— basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:450-454 | basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:519-523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:450` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:247— basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:247-251 | basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:262-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:247` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) basex-core/src/main/java/org/basex/query/util/format/FormatterFR.java:105— basex-core/src/main/java/org/basex/query/util/format/FormatterFR.java:105-109 | basex-core/src/main/java/org/basex/query/util/format/FormatterFR.java:112-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/util/format/FormatterFR.java:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
FileTooLong: query/QueryParser.java basex-core/src/main/java/org/basex/query/QueryParser.java— FileTooLong — 3164 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: QueryParser (56-5605). The bar is 500 significant lines; this is 2664 over it, 6.33× 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: func/Function.java basex-core/src/main/java/org/basex/query/func/Function.java— FileTooLong — 1501 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Function (65-2387). The bar is 500 significant lines; this is 1001 over it, 3.00× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: text/TextEditor.java basex-core/src/main/java/org/basex/gui/text/TextEditor.java— FileTooLong — 1113 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: TextEditor (20-2287). The bar is 500 significant lines; this is 613 over it, 2.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: query/QueryError.java basex-core/src/main/java/org/basex/query/QueryError.java— FileTooLong — 892 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: QueryError (26-2136). The bar is 500 significant lines; this is 392 over it, 1.78× 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: static/js.js basex-modules/dba/src/main/resources/static/js.js— FileTooLong — 851 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 351 over it, 1.70× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: text/TextPanel.java basex-core/src/main/java/org/basex/gui/text/TextPanel.java— FileTooLong — 841 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: TextPanel (32-1687). The bar is 500 significant lines; this is 341 over it, 1.68× 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: text/SyntaxXQuery.java basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java— FileTooLong — 800 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: SyntaxXQuery (34-1390). The bar is 500 significant lines; this is 300 over it, 1.60× 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: core/Text.java basex-core/src/main/java/org/basex/core/Text.java— FileTooLong — 759 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: Text (24-1498). The bar is 500 significant lines; this is 259 over it, 1.52× 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: gflwor/GFLWOR.java basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java— FileTooLong — 740 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: GFLWOR (31-1401). The bar is 500 significant lines; this is 240 over it, 1.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: ft/GreekStemmer.java basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java— FileTooLong — 738 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: GreekStemmer (14-1108). The bar is 500 significant lines; this is 238 over it, 1.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: editor/EditorView.java basex-core/src/main/java/org/basex/gui/view/editor/EditorView.java— FileTooLong — 677 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: EditorView (49-1245). The bar is 500 significant lines; this is 177 over it, 1.35× 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: util/Token.java basex-core/src/main/java/org/basex/util/Token.java— FileTooLong — 665 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: Token (25-1586). The bar is 500 significant lines; this is 165 over it, 1.33× 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: type/BasicType.java basex-core/src/main/java/org/basex/query/value/type/BasicType.java— FileTooLong — 642 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: BasicType (29-1089). The bar is 500 significant lines; this is 142 over it, 1.28× 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: xml/XMLScanner.java basex-core/src/main/java/org/basex/build/xml/XMLScanner.java— FileTooLong — 632 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: XMLScanner (28-1141). The bar is 500 significant lines; this is 132 over it, 1.26× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: tree/TreeView.java basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java— FileTooLong — 632 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: TreeView (29-1100). The bar is 500 significant lines; this is 132 over it, 1.26× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: plot/PlotView.java basex-core/src/main/java/org/basex/gui/view/plot/PlotView.java— FileTooLong — 628 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: PlotView (28-1060). The bar is 500 significant lines; this is 128 over it, 1.26× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: text/TextRenderer.java basex-core/src/main/java/org/basex/gui/text/TextRenderer.java— FileTooLong — 590 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: TextRenderer (19-1221). The bar is 500 significant lines; this is 90 over it, 1.18× 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: path/Path.java basex-core/src/main/java/org/basex/query/expr/path/Path.java— FileTooLong — 586 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: Path (36-1142). The bar is 500 significant lines; this is 86 over it, 1.17× 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: options/Options.java basex-core/src/main/java/org/basex/util/options/Options.java— FileTooLong — 565 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: Options (36-1248). The bar is 500 significant lines; this is 65 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: func/StandardFunc.java basex-core/src/main/java/org/basex/query/func/StandardFunc.java— FileTooLong — 546 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: StandardFunc (49-1372). The bar is 500 significant lines; this is 46 over it, 1.09× 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: data/Data.java basex-core/src/main/java/org/basex/data/Data.java— FileTooLong — 540 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Data (71-1359). The bar is 500 significant lines; this is 40 over it, 1.08× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: fingertree/DeepTree.java basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java— FileTooLong — 503 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: DeepTree (16-871). 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.
Duplicated block (7 lines × 2) REDACTED:264— REDACTED:264-270 | REDACTED:286-292 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:264` it does not close everything it opens, so those exact lines 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) basex-core/src/main/java/org/basex/query/expr/CmpIR.java:155— basex-core/src/main/java/org/basex/query/expr/CmpIR.java:155-161 | basex-core/src/main/java/org/basex/query/expr/CmpR.java:308-314 — 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 `basex-core/src/main/java/org/basex/query/expr/CmpIR.java:155` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:36— basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:36-42 | basex-core/src/main/java/org/basex/query/expr/ft/FTOr.java:36-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:36` it does not close everything it opens, so those exact lines 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) basex-core/src/main/java/org/basex/query/func/fn/FnLowest.java:76— basex-core/src/main/java/org/basex/query/func/fn/FnLowest.java:76-82 | basex-core/src/main/java/org/basex/query/func/fn/FnSort.java:21-27 — 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 `basex-core/src/main/java/org/basex/query/func/fn/FnLowest.java:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `basex-core/src/main/java/org/basex/query/func/fn/FnLowest.java:64` calls `opt` and `basex-core/src/main/java/org/basex/query/func/fn/FnSort.java:19` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/query/util/collation/BaseXCollation.java:53— basex-core/src/main/java/org/basex/query/util/collation/BaseXCollation.java:53-59 | basex-core/src/main/java/org/basex/query/util/collation/UCACollation.java:82-88 — 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 `basex-core/src/main/java/org/basex/query/util/collation/BaseXCollation.java:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:263— basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:263-269 | basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:281-287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:87— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:87-93 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:87-93 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:87` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `siblings` to `Node<Value, Value>[]` in one and `Node<Item, Item>[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:111— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:111-117 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:111-117 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `left` to `Node<Value, Value>` in one and `Node<Item, Item>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/query/value/map/XQAtmIntMap.java:70— basex-core/src/main/java/org/basex/query/value/map/XQAtmIntMap.java:70-76 | basex-core/src/main/java/org/basex/query/value/map/XQAtmStrMap.java:69-75 — 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 `basex-core/src/main/java/org/basex/query/value/map/XQAtmIntMap.java:70` 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 (7 lines × 2) basex-core/src/main/java/org/basex/query/value/map/XQIntMap.java:69— basex-core/src/main/java/org/basex/query/value/map/XQIntMap.java:69-75 | basex-core/src/main/java/org/basex/query/value/map/XQIntStrMap.java:70-76 — 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 `basex-core/src/main/java/org/basex/query/value/map/XQIntMap.java:69` 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 (7 lines × 2) basex-core/src/main/java/org/basex/query/value/map/XQStrIntMap.java:68— basex-core/src/main/java/org/basex/query/value/map/XQStrIntMap.java:68-74 | basex-core/src/main/java/org/basex/query/value/map/XQStrMap.java:67-73 — 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 `basex-core/src/main/java/org/basex/query/value/map/XQStrIntMap.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 matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:226— basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:226-232 | basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:321-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:210— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:210-216 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:207-213 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:210` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `nodes` to `NodeLike<Value, Value>[]` in one and `NodeLike<Item, Item>[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/query/value/array/PartialLeafNode.java:57— basex-core/src/main/java/org/basex/query/value/array/PartialLeafNode.java:57-63 | basex-core/src/main/java/org/basex/query/value/seq/tree/PartialLeafNode.java:51-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/PartialLeafNode.java:57` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `nodes` to `NodeLike<Value, Value>[]` in one and `NodeLike<Item, Item>[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/query/func/fn/FnAllDifferent.java:41— basex-core/src/main/java/org/basex/query/func/fn/FnAllDifferent.java:41-47 | basex-core/src/main/java/org/basex/query/func/fn/FnAllEqual.java:44-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/func/fn/FnAllDifferent.java:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/query/func/fn/FnTail.java:87— basex-core/src/main/java/org/basex/query/func/fn/FnTail.java:87-93 | basex-core/src/main/java/org/basex/query/func/fn/FnTrunk.java:106-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `basex-core/src/main/java/org/basex/query/func/fn/FnTail.java:96` calls `merge` and `basex-core/src/main/java/org/basex/query/func/fn/FnTrunk.java:115` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/io/serial/MarkupSerializer.java:121— basex-core/src/main/java/org/basex/io/serial/MarkupSerializer.java:121-127 | basex-core/src/main/java/org/basex/io/serial/TextSerializer.java:27-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/query/expr/Logical.java:35— basex-core/src/main/java/org/basex/query/expr/Logical.java:35-41 | basex-core/src/main/java/org/basex/query/expr/Otherwise.java:80-86 — 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 (7 lines × 2) basex-core/src/main/java/org/basex/query/func/array/ArrayInsertBefore.java:25— basex-core/src/main/java/org/basex/query/func/array/ArrayInsertBefore.java:25-31 | basex-core/src/main/java/org/basex/query/func/array/ArrayPut.java:25-31 — 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 (7 lines × 2) basex-core/src/main/java/org/basex/util/hash/IntMap.java:43— basex-core/src/main/java/org/basex/util/hash/IntMap.java:43-49 | basex-core/src/main/java/org/basex/util/hash/TokenIntMap.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 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `key` to `int` in one and `byte[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) basex-core/src/main/java/org/basex/index/IdPreMap.java:536— basex-core/src/main/java/org/basex/index/IdPreMap.java:536-542 | basex-core/src/main/java/org/basex/index/IdPreMap.java:559-565 — both copies are in the same file, so extract the 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· Edited copy of a member (5 corresponding lines) · ×20
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnRandomNumberGenerator.java:65— basex-core/src/main/java/org/basex/query/func/fn/FnRandomNumberGenerator.java:65-71 | basex-core/src/main/java/org/basex/query/func/fn/FnRandomNumberGenerator.java:80-84 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/value/type/BasicType.java:469— basex-core/src/main/java/org/basex/query/value/type/BasicType.java:469-473 | basex-core/src/main/java/org/basex/query/value/type/BasicType.java:484-488 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/func/bin/BinPackDouble.java:16— basex-core/src/main/java/org/basex/query/func/bin/BinPackDouble.java:16-20 | basex-core/src/main/java/org/basex/query/func/bin/BinPackFloat.java:16-20 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/util/ft/JapaneseTokenizer.java:123— basex-core/src/main/java/org/basex/util/ft/JapaneseTokenizer.java:123-128 | basex-core/src/main/java/org/basex/util/ft/WesternTokenizer.java:68-72 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/value/item/Atm.java:78— basex-core/src/main/java/org/basex/query/value/item/Atm.java:78-82 | basex-core/src/main/java/org/basex/query/value/node/XNode.java:99-103 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/func/array/ArrayFoot.java:17— basex-core/src/main/java/org/basex/query/func/array/ArrayFoot.java:17-21 | basex-core/src/main/java/org/basex/query/func/array/ArrayHead.java:17-21 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/func/store/StoreGet.java:14— basex-core/src/main/java/org/basex/query/func/store/StoreGet.java:14-18 | basex-core/src/main/java/org/basex/query/func/store/StoreRemove.java:14-19 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/util/fingertree/PartialInnerNode.java:104— basex-core/src/main/java/org/basex/query/util/fingertree/PartialInnerNode.java:104-108 | basex-core/src/main/java/org/basex/query/util/fingertree/SingletonTree.java:134-138 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnParseIetfDate.java:381— basex-core/src/main/java/org/basex/query/func/fn/FnParseIetfDate.java:381-385 | basex-core/src/main/java/org/basex/query/value/item/ADate.java:427-431 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Mapping.java:34— basex-core/src/main/java/org/basex/query/expr/Mapping.java:34-38 | basex-core/src/main/java/org/basex/query/expr/path/Path.java:123-128 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Arr.java:46— basex-core/src/main/java/org/basex/query/expr/Arr.java:46-50 | basex-core/src/main/java/org/basex/query/expr/ft/FTExpr.java:43-47 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/expr/constr/CArray.java:48— basex-core/src/main/java/org/basex/query/expr/constr/CArray.java:48-52 | basex-core/src/main/java/org/basex/query/func/java/JavaCall.java:103-107 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/func/client/ClientSessions.java:32— basex-core/src/main/java/org/basex/query/func/client/ClientSessions.java:32-36 | basex-core/src/main/java/org/basex/query/func/sql/JDBCConnections.java:37-41 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/core/cmd/Check.java:96— basex-core/src/main/java/org/basex/core/cmd/Check.java:96-101 | basex-core/src/main/java/org/basex/core/cmd/CreateDB.java:132-136 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/func/array/ArrayRemove.java:54— basex-core/src/main/java/org/basex/query/func/array/ArrayRemove.java:54-58 | basex-core/src/main/java/org/basex/query/func/array/ArraySlice.java:31-35 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnAtomicEqual.java:22— basex-core/src/main/java/org/basex/query/func/fn/FnAtomicEqual.java:22-26 | basex-core/src/main/java/org/basex/query/func/map/MapContains.java:22-26 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/func/Closure.java:423— basex-core/src/main/java/org/basex/query/func/Closure.java:423-427 | basex-core/src/main/java/org/basex/query/func/StaticFunc.java:394-398 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/up/primitives/name/DBAlter.java:37— basex-core/src/main/java/org/basex/query/up/primitives/name/DBAlter.java:37-42 | basex-core/src/main/java/org/basex/query/up/primitives/name/DBDrop.java:29-33 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/up/expr/Transform.java:56— basex-core/src/main/java/org/basex/query/up/expr/Transform.java:56-60 | basex-core/src/main/java/org/basex/query/up/expr/TransformWith.java:44-49 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) basex-core/src/main/java/org/basex/query/func/store/StoreDelete.java:14— basex-core/src/main/java/org/basex/query/func/store/StoreDelete.java:14-18 | basex-core/src/main/java/org/basex/query/func/store/StoreRead.java:14-18 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×19
Edited copy of a member (8 corresponding lines) basex-core/src/main/java/org/basex/query/func/user/UserDrop.java:21— basex-core/src/main/java/org/basex/query/func/user/UserDrop.java:21-28 | basex-core/src/main/java/org/basex/query/func/user/UserGrant.java:23-31 — 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) basex-core/src/main/java/org/basex/query/func/string/StringScore.java:26— basex-core/src/main/java/org/basex/query/func/string/StringScore.java:26-34 | basex-core/src/main/java/org/basex/query/func/string/StringScore.java:44-51 — 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) basex-core/src/main/java/org/basex/query/func/db/DbPutBinary.java:19— basex-core/src/main/java/org/basex/query/func/db/DbPutBinary.java:19-27 | basex-core/src/main/java/org/basex/query/func/db/DbPutValue.java:18-25 — 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) basex-core/src/main/java/org/basex/query/util/ft/FTPosData.java:216— basex-core/src/main/java/org/basex/query/util/ft/FTPosData.java:216-223 | basex-core/src/main/java/org/basex/util/hash/TokenSet.java:217-225 — 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) basex-core/src/main/java/org/basex/api/dom/BXNode.java:272— basex-core/src/main/java/org/basex/api/dom/BXNode.java:272-281 | basex-core/src/main/java/org/basex/query/util/pkg/RepoManager.java:307-314 — 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) basex-core/src/main/java/org/basex/query/up/atomic/Delete.java:53— basex-core/src/main/java/org/basex/query/up/atomic/Delete.java:53-60 | basex-core/src/main/java/org/basex/query/up/atomic/Insert.java:58-65 — 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) basex-core/src/main/java/org/basex/util/XMLToken.java:203— basex-core/src/main/java/org/basex/util/XMLToken.java:203-210 | basex-core/src/main/java/org/basex/util/XMLToken.java:259-266 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) basex-core/src/main/java/org/basex/query/QueryParser.java:4648— basex-core/src/main/java/org/basex/query/QueryParser.java:4648-4655 | basex-core/src/main/java/org/basex/query/QueryParser.java:4663-4670 — 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) basex-core/src/main/java/org/basex/query/func/db/DbCreate.java:18— basex-core/src/main/java/org/basex/query/func/db/DbCreate.java:18-25 | basex-core/src/main/java/org/basex/query/func/db/DbOptimize.java:18-25 — 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) basex-core/src/main/java/org/basex/query/func/cache/CachePut.java:15— basex-core/src/main/java/org/basex/query/func/cache/CachePut.java:15-22 | basex-core/src/main/java/org/basex/query/func/store/StorePut.java:15-22 — 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) basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:36— basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:36-43 | basex-core/src/main/java/org/basex/query/value/array/BigArray.java:33-40 — 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) basex-api/src/main/java/org/basex/query/func/request/RequestCookieMap.java:17— basex-api/src/main/java/org/basex/query/func/request/RequestCookieMap.java:17-26 | basex-api/src/main/java/org/basex/query/func/request/RequestCookieNames.java:19-26 — 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) basex-core/src/main/java/org/basex/query/value/array/XQArray.java:286— basex-core/src/main/java/org/basex/query/value/array/XQArray.java:286-293 | basex-core/src/main/java/org/basex/query/value/seq/Seq.java:184-191 — 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) basex-core/src/main/java/org/basex/query/QueryException.java:345— basex-core/src/main/java/org/basex/query/QueryException.java:345-352 | basex-core/src/main/java/org/basex/query/func/fn/MapToElement.java:694-702 — 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) basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:247— basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:247-256 | basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:917-924 — 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) basex-core/src/main/java/org/basex/query/expr/If.java:86— basex-core/src/main/java/org/basex/query/expr/If.java:86-94 | basex-core/src/main/java/org/basex/query/expr/SwitchGroup.java:43-50 — 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) basex-core/src/main/java/org/basex/query/expr/gflwor/Where.java:28— basex-core/src/main/java/org/basex/query/expr/gflwor/Where.java:28-38 | basex-core/src/main/java/org/basex/query/expr/gflwor/While.java:28-35 — 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) basex-core/src/main/java/org/basex/query/func/sql/SqlCommit.java:19— basex-core/src/main/java/org/basex/query/func/sql/SqlCommit.java:19-26 | basex-core/src/main/java/org/basex/query/func/sql/SqlRollback.java:19-26 — 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) basex-core/src/main/java/org/basex/query/value/item/B64.java:111— basex-core/src/main/java/org/basex/query/value/item/B64.java:111-118 | basex-core/src/main/java/org/basex/query/value/item/StrLazy.java:109-116 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×19
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:676— basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:676-681 | basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:689-694 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/value/type/Kind.java:51— basex-core/src/main/java/org/basex/query/value/type/Kind.java:51-56 | basex-core/src/main/java/org/basex/query/value/type/Kind.java:98-103 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/util/fingertree/SingletonTree.java:27— basex-core/src/main/java/org/basex/query/util/fingertree/SingletonTree.java:27-32 | basex-core/src/main/java/org/basex/query/util/fingertree/SingletonTree.java:35-40 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/expr/MixedPos.java:31— basex-core/src/main/java/org/basex/query/expr/MixedPos.java:31-36 | basex-core/src/main/java/org/basex/query/expr/Pos.java:188-193 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:219— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:219-224 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:216-221 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/util/format/FormatterFR.java:46— basex-core/src/main/java/org/basex/query/util/format/FormatterFR.java:46-51 | basex-core/src/main/java/org/basex/query/util/format/FormatterDE.java:76-81 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:49— basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:49-54 | basex-core/src/main/java/org/basex/query/expr/ft/FTOr.java:49-54 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/value/seq/StrSeq.java:50— basex-core/src/main/java/org/basex/query/value/seq/StrSeq.java:50-55 | basex-core/src/main/java/org/basex/util/Token.java:1235-1240 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/func/StaticFunc.java:436— basex-core/src/main/java/org/basex/query/func/StaticFunc.java:436-441 | basex-core/src/main/java/org/basex/query/value/item/FuncItem.java:264-269 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/func/array/ArrayPut.java:17— basex-core/src/main/java/org/basex/query/func/array/ArrayPut.java:17-22 | basex-core/src/main/java/org/basex/query/func/http/HttpSendRequest.java:17-23 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/value/seq/IntSeq.java:41— basex-core/src/main/java/org/basex/query/value/seq/IntSeq.java:41-46 | basex-core/src/main/java/org/basex/io/in/DataInput.java:71-76 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnMin.java:82— basex-core/src/main/java/org/basex/query/func/fn/FnMin.java:82-89 | basex-core/src/main/java/org/basex/query/func/fn/FnSum.java:126-131 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/gui/view/map/MapView.java:422— basex-core/src/main/java/org/basex/gui/view/map/MapView.java:422-427 | basex-core/src/main/java/org/basex/gui/view/plot/PlotView.java:939-944 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-api/src/main/java/org/basex/query/func/sessions/SessionsDelete.java:16— basex-api/src/main/java/org/basex/query/func/sessions/SessionsDelete.java:16-22 | basex-api/src/main/java/org/basex/query/func/ws/WsDelete.java:16-21 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/MapToElement.java:503— basex-core/src/main/java/org/basex/query/func/fn/MapToElement.java:503-508 | basex-core/src/main/java/org/basex/query/func/fn/SortFn.java:101-107 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/value/type/Kind.java:192— basex-core/src/main/java/org/basex/query/value/type/Kind.java:192-197 | basex-core/src/main/java/org/basex/query/var/GlobalValues.java:157-162 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/io/serial/HTMLSerializer.java:86— basex-core/src/main/java/org/basex/io/serial/HTMLSerializer.java:86-91 | basex-core/src/main/java/org/basex/io/serial/MarkupSerializer.java:275-281 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Try.java:262— basex-core/src/main/java/org/basex/query/expr/Try.java:262-267 | basex-core/src/main/java/org/basex/query/up/expr/Transform.java:116-121 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) basex-core/src/main/java/org/basex/query/value/array/XQArray.java:297— basex-core/src/main/java/org/basex/query/value/array/XQArray.java:297-302 | basex-core/src/main/java/org/basex/query/value/seq/Seq.java:195-200 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×14
Edited copy of a member (9 corresponding lines) basex-core/src/main/java/org/basex/query/value/item/Dur.java:228— basex-core/src/main/java/org/basex/query/value/item/Dur.java:228-236 | basex-core/src/main/java/org/basex/query/value/item/Dur.java:242-252 — 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) basex-core/src/main/java/org/basex/io/in/DataInput.java:95— basex-core/src/main/java/org/basex/io/in/DataInput.java:95-103 | basex-core/src/main/java/org/basex/io/random/DataAccess.java:592-600 — 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) basex-core/src/main/java/org/basex/query/func/fn/FnRegex.java:47— basex-core/src/main/java/org/basex/query/func/fn/FnRegex.java:47-55 | basex-core/src/main/java/org/basex/query/func/fn/FnRegex.java:65-74 — 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) basex-core/src/main/java/org/basex/query/func/map/MapFilter.java:18— basex-core/src/main/java/org/basex/query/func/map/MapFilter.java:18-28 | basex-core/src/main/java/org/basex/query/func/map/MapForEach.java:58-66 — 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) basex-core/src/main/java/org/basex/query/func/fn/FnDoUntil.java:16— basex-core/src/main/java/org/basex/query/func/fn/FnDoUntil.java:16-24 | basex-core/src/main/java/org/basex/query/func/fn/FnWhileDo.java:18-26 — 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) basex-core/src/main/java/org/basex/util/Token.java:1381— basex-core/src/main/java/org/basex/util/Token.java:1381-1389 | basex-core/src/main/java/org/basex/util/Token.java:1432-1440 — 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) basex-core/src/main/java/org/basex/query/value/item/B64.java:141— basex-core/src/main/java/org/basex/query/value/item/B64.java:141-149 | basex-core/src/main/java/org/basex/query/value/item/Hex.java:98-106 — 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) basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeBuilder.java:286— basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeBuilder.java:286-294 | basex-core/src/main/java/org/basex/query/value/seq/tree/TreeSeqBuilder.java:185-195 — 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) basex-core/src/main/java/org/basex/query/expr/Catch.java:78— basex-core/src/main/java/org/basex/query/expr/Catch.java:78-86 | basex-core/src/main/java/org/basex/query/expr/Catch.java:117-126 — 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) basex-core/src/main/java/org/basex/query/func/array/ArrayReverse.java:24— basex-core/src/main/java/org/basex/query/func/array/ArrayReverse.java:24-32 | basex-core/src/main/java/org/basex/query/func/array/ArraySubarray.java:39-47 — 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) basex-core/src/main/java/org/basex/query/value/seq/DblSeq.java:68— basex-core/src/main/java/org/basex/query/value/seq/DblSeq.java:68-76 | basex-core/src/main/java/org/basex/query/value/seq/FltSeq.java:68-76 — 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) basex-core/src/main/java/org/basex/index/path/PathIndex.java:209— basex-core/src/main/java/org/basex/index/path/PathIndex.java:209-218 | basex-core/src/main/java/org/basex/query/func/util/UtilRoot.java:83-91 — 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) basex-core/src/main/java/org/basex/io/serial/MarkupSerializer.java:298— basex-core/src/main/java/org/basex/io/serial/MarkupSerializer.java:298-306 | basex-core/src/main/java/org/basex/io/serial/HTMLSerializer.java:122-130 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) basex-core/src/main/java/org/basex/query/value/item/Dat.java:45— basex-core/src/main/java/org/basex/query/value/item/Dat.java:45-54 | basex-core/src/main/java/org/basex/query/value/item/Dtm.java:88-96 — 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.
No assertions: ok basex-api/src/test/java/org/basex/http/auth/BasicAuthTest.java:35— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: conditions basex-api/src/test/java/org/basex/http/webdav/WebDAVTest.java:253— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: deleteOnlyMember basex-api/src/test/java/org/basex/http/webdav/WebDAVTest.java:542— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: invalidBody basex-api/src/test/java/org/basex/http/webdav/WebDAVTest.java:394— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: lockCollection basex-api/src/test/java/org/basex/http/webdav/WebDAVTest.java:718— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: lockNull basex-api/src/test/java/org/basex/http/webdav/WebDAVTest.java:705— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: lockReleasedOnDelete basex-api/src/test/java/org/basex/http/webdav/WebDAVTest.java:739— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: lockedDestination basex-api/src/test/java/org/basex/http/webdav/WebDAVTest.java:579— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: missingParent basex-api/src/test/java/org/basex/http/webdav/WebDAVTest.java:309— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: missingTargetDatabase basex-api/src/test/java/org/basex/http/webdav/WebDAVTest.java:530— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: moveOntoResource basex-api/src/test/java/org/basex/http/webdav/WebDAVTest.java:356— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: unknownLockToken basex-api/src/test/java/org/basex/http/webdav/WebDAVTest.java:470— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: nestedMultipart basex-api/src/test/java/org/basex/http/FnHttpTest.java:841— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×11
Edited copy of a member (10 corresponding lines) basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:221— basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:221-230 | basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:233-243 — 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) basex-core/src/main/java/org/basex/query/func/inspect/Inspect.java:122— basex-core/src/main/java/org/basex/query/func/inspect/Inspect.java:122-136 | basex-core/src/main/java/org/basex/query/func/inspect/Inspect.java:144-153 — 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) basex-core/src/main/java/org/basex/query/value/item/Dbl.java:177— basex-core/src/main/java/org/basex/query/value/item/Dbl.java:177-186 | basex-core/src/main/java/org/basex/query/value/item/Flt.java:140-149 — 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) basex-core/src/main/java/org/basex/data/NSSets.java:144— basex-core/src/main/java/org/basex/data/NSSets.java:144-155 | basex-core/src/main/java/org/basex/util/Token.java:1544-1553 — 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) basex-core/src/main/java/org/basex/query/QueryParser.java:2164— basex-core/src/main/java/org/basex/query/QueryParser.java:2164-2173 | basex-core/src/main/java/org/basex/query/QueryParser.java:2180-2191 — 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) basex-core/src/main/java/org/basex/query/func/fn/FnAllDifferent.java:28— basex-core/src/main/java/org/basex/query/func/fn/FnAllDifferent.java:28-37 | basex-core/src/main/java/org/basex/query/func/fn/FnDistinctValues.java:30-43 — 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) basex-core/src/main/java/org/basex/query/func/fn/FnEndsWithSubsequence.java:16— basex-core/src/main/java/org/basex/query/func/fn/FnEndsWithSubsequence.java:16-25 | basex-core/src/main/java/org/basex/query/func/fn/FnStartsWithSubsequence.java:22-31 — 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) basex-core/src/main/java/org/basex/query/value/array/XQArray.java:369— basex-core/src/main/java/org/basex/query/value/array/XQArray.java:369-378 | basex-core/src/main/java/org/basex/query/value/map/XQMap.java:603-613 — 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) basex-core/src/main/java/org/basex/query/expr/constr/CAttr.java:41— basex-core/src/main/java/org/basex/query/expr/constr/CAttr.java:41-50 | basex-core/src/main/java/org/basex/query/expr/constr/CPI.java:37-46 — 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) basex-core/src/main/java/org/basex/query/func/array/ArraySortBy.java:54— basex-core/src/main/java/org/basex/query/func/array/ArraySortBy.java:54-66 | basex-core/src/main/java/org/basex/query/func/fn/FnSortBy.java:53-62 — 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) basex-core/src/main/java/org/basex/data/DiskData.java:283— basex-core/src/main/java/org/basex/data/DiskData.java:283-292 | basex-core/src/main/java/org/basex/data/MemData.java:114-123 — 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.
Low cohesion: Sftp (LCOM4 12) basex-modules/sftp/src/main/java/org/basex/modules/Sftp.java:32— Sftp's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: QueryException (LCOM4 6) basex-core/src/main/java/org/basex/query/QueryException.java:27— QueryException's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Request (LCOM4 6) basex-core/src/main/java/org/basex/util/http/Request.java:22— Request's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: StaticFuncs (LCOM4 5) basex-core/src/main/java/org/basex/query/func/StaticFuncs.java:34— StaticFuncs's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CompileContext (LCOM4 5) basex-core/src/main/java/org/basex/query/CompileContext.java:34— CompileContext's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: GUIStatus (LCOM4 5) basex-core/src/main/java/org/basex/gui/GUIStatus.java:26— GUIStatus's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: FuncDefinition (LCOM4 4) basex-core/src/main/java/org/basex/query/func/FuncDefinition.java:22— FuncDefinition's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: SharedData (LCOM4 4) basex-core/src/main/java/org/basex/query/util/SharedData.java:19— SharedData's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Variables (LCOM4 4) basex-core/src/main/java/org/basex/query/var/Variables.java:24— Variables's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: BaseXTextField (LCOM4 4) basex-core/src/main/java/org/basex/gui/layout/BaseXTextField.java:26— BaseXTextField's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: IndexBuilder (LCOM4 4) basex-core/src/main/java/org/basex/index/IndexBuilder.java:22— IndexBuilder's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
MethodTooLong: SyntaxXQuery.scan basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:915— MethodTooLong — scan runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MapRenderer.computeToolTip basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:449— MethodTooLong — computeToolTip 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: DigitalSignature.generate REDACTED:103— MethodTooLong — generate 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: QueryJob.run basex-core/src/main/java/org/basex/core/jobs/QueryJob.java:245— MethodTooLong — run runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TextPanel.keyPressed basex-core/src/main/java/org/basex/gui/text/TextPanel.java:877— MethodTooLong — keyPressed runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FnLoadXQueryModule.value basex-core/src/main/java/org/basex/query/func/fn/FnLoadXQueryModule.java:42— MethodTooLong — value runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: XMLParser.command basex-core/src/main/java/org/basex/core/parse/XMLParser.java:63— MethodTooLong — command runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× 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: BaseXList.<init> basex-core/src/main/java/org/basex/gui/layout/BaseXList.java:54— MethodTooLong — <init> 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: EditorView.<init> basex-core/src/main/java/org/basex/gui/view/editor/EditorView.java:111— MethodTooLong — <init> 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.
MethodTooLong: XMLScanner.markupDecl basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:808— MethodTooLong — markupDecl runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×10
Edited copy of a member (13 corresponding lines) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:123— basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:123-136 | basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:139-151 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) basex-core/src/main/java/org/basex/io/random/DataAccess.java:701— basex-core/src/main/java/org/basex/io/random/DataAccess.java:701-715 | basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:811-823 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Calc.java:306— basex-core/src/main/java/org/basex/query/expr/Calc.java:306-318 | basex-core/src/main/java/org/basex/query/expr/Calc.java:362-374 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoInteriorRingN.java:18— basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoInteriorRingN.java:18-30 | basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoPointN.java:18-30 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) basex-core/src/main/java/org/basex/io/parse/json/JsonParser.java:139— basex-core/src/main/java/org/basex/io/parse/json/JsonParser.java:139-162 | basex-core/src/main/java/org/basex/io/parse/json/JsonParser.java:198-210 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) basex-core/src/main/java/org/basex/query/value/seq/DBNodes.java:142— basex-core/src/main/java/org/basex/query/value/seq/DBNodes.java:142-154 | basex-core/src/main/java/org/basex/query/value/seq/DBNodes.java:163-175 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) basex-core/src/main/java/org/basex/data/DiskData.java:225— basex-core/src/main/java/org/basex/data/DiskData.java:225-239 | basex-core/src/main/java/org/basex/data/MemData.java:85-97 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) basex-core/src/main/java/org/basex/query/expr/CmpIR.java:200— basex-core/src/main/java/org/basex/query/expr/CmpIR.java:200-212 | basex-core/src/main/java/org/basex/query/expr/IntPos.java:134-146 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) basex-core/src/main/java/org/basex/util/Token.java:888— basex-core/src/main/java/org/basex/util/Token.java:888-900 | basex-core/src/main/java/org/basex/util/Token.java:908-921 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:264— basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:264-276 | basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:599-612 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×10
Edited copy of a member (11 corresponding lines) basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:132— basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:132-142 | basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:148-164 — 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) basex-core/src/main/java/org/basex/index/ft/FTSegment.java:267— basex-core/src/main/java/org/basex/index/ft/FTSegment.java:267-277 | basex-core/src/main/java/org/basex/index/ft/FTSegment.java:322-335 — 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) basex-core/src/main/java/org/basex/query/up/primitives/db/DBPut.java:43— basex-core/src/main/java/org/basex/query/up/primitives/db/DBPut.java:43-53 | basex-core/src/main/java/org/basex/query/up/primitives/db/DBPutBinary.java:42-54 — 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) basex-core/src/main/java/org/basex/query/func/db/DbDropBackup.java:20— basex-core/src/main/java/org/basex/query/func/db/DbDropBackup.java:20-32 | basex-core/src/main/java/org/basex/query/func/db/DbRestore.java:21-31 — 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) basex-core/src/main/java/org/basex/query/util/format/Formatter.java:473— basex-core/src/main/java/org/basex/query/util/format/Formatter.java:473-483 | basex-core/src/main/java/org/basex/util/Token.java:1396-1406 — 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) basex-core/src/main/java/org/basex/query/func/array/ArrayFilter.java:32— basex-core/src/main/java/org/basex/query/func/array/ArrayFilter.java:32-42 | basex-core/src/main/java/org/basex/query/func/array/ArrayForEach.java:32-46 — 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) basex-core/src/main/java/org/basex/util/Token.java:533— basex-core/src/main/java/org/basex/util/Token.java:533-547 | basex-core/src/main/java/org/basex/util/Token.java:554-564 — 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) basex-core/src/main/java/org/basex/gui/GUIToolBar.java:41— basex-core/src/main/java/org/basex/gui/GUIToolBar.java:41-51 | basex-core/src/main/java/org/basex/gui/layout/BaseXPopup.java:90-100 — 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) basex-core/src/main/java/org/basex/query/func/user/UserFn.java:34— basex-core/src/main/java/org/basex/query/func/user/UserFn.java:34-44 | basex-core/src/main/java/org/basex/query/func/user/UserFn.java:99-110 — 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) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:53— basex-core/src/main/java/org/basex/query/value/array/BigArray.java:53-63 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:56-66 — 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 (3 corresponding lines) · ×10
Edited copy of a member (3 corresponding lines) basex-core/src/main/java/org/basex/gui/text/SyntaxMD.java:246— basex-core/src/main/java/org/basex/gui/text/SyntaxMD.java:246-248 | basex-core/src/main/java/org/basex/query/QueryParser.java:3896-3899 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) basex-core/src/main/java/org/basex/query/expr/index/RangeAccess.java:79— basex-core/src/main/java/org/basex/query/expr/index/RangeAccess.java:79-81 | basex-core/src/main/java/org/basex/query/expr/index/StringRangeAccess.java:115-117 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) basex-core/src/main/java/org/basex/query/func/StaticFuncs.java:420— basex-core/src/main/java/org/basex/query/func/StaticFuncs.java:420-422 | basex-core/src/main/java/org/basex/query/var/Variables.java:267-269 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) basex-core/src/main/java/org/basex/query/up/expr/Rename.java:86— basex-core/src/main/java/org/basex/query/up/expr/Rename.java:86-88 | basex-core/src/main/java/org/basex/query/up/expr/Replace.java:97-99 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) basex-core/src/main/java/org/basex/query/expr/HashFilter.java:146— basex-core/src/main/java/org/basex/query/expr/HashFilter.java:146-148 | basex-core/src/main/java/org/basex/query/expr/RangeFilter.java:145-147 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) basex-core/src/main/java/org/basex/query/expr/constr/CNSpace.java:58— basex-core/src/main/java/org/basex/query/expr/constr/CNSpace.java:58-60 | basex-core/src/main/java/org/basex/query/expr/constr/CPI.java:59-61 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) basex-core/src/main/java/org/basex/query/value/item/AStr.java:171— basex-core/src/main/java/org/basex/query/value/item/AStr.java:171-173 | basex-core/src/main/java/org/basex/query/value/item/Atm.java:72-74 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Switch.java:275— basex-core/src/main/java/org/basex/query/expr/Switch.java:275-277 | basex-core/src/main/java/org/basex/query/expr/Typeswitch.java:156-158 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) basex-core/src/main/java/org/basex/query/expr/CmpG.java:496— basex-core/src/main/java/org/basex/query/expr/CmpG.java:496-498 | basex-core/src/main/java/org/basex/query/expr/CmpV.java:125-127 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/ParseCsv.java:63— basex-core/src/main/java/org/basex/query/func/fn/ParseCsv.java:63-65 | basex-core/src/main/java/org/basex/query/func/fn/ParseJson.java:50-52 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (9 lines × 2) basex-core/src/main/java/org/basex/query/func/fn/FnTail.java:71— basex-core/src/main/java/org/basex/query/func/fn/FnTail.java:71-79 | basex-core/src/main/java/org/basex/query/func/fn/FnTrunk.java:88-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:257— basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:257-265 | basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:353-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:257` it does not close everything it opens, so those exact lines 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) basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:367— basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:367-375 | basex-core/src/main/java/org/basex/query/util/fingertree/PartialInnerNode.java:63-71 — 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 `basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:367` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) basex-core/src/main/java/org/basex/query/value/node/DBNode.java:370— basex-core/src/main/java/org/basex/query/value/node/DBNode.java:370-378 | basex-core/src/main/java/org/basex/query/value/node/DBNode.java:502-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/node/DBNode.java:370` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:210— basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:210-218 | basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:220-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:210` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:61— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:61-69 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:61-69 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:61` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `siblings` to `Node<Value, Value>[]` in one and `Node<Item, Item>[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:113— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:113-121 | basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:130-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:113— basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:113-121 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:130-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) basex-core/src/main/java/org/basex/query/expr/ASwitch.java:124— basex-core/src/main/java/org/basex/query/expr/ASwitch.java:124-132 | basex-core/src/main/java/org/basex/query/expr/If.java:227-235 — 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 (9 lines × 2) basex-core/src/main/java/org/basex/query/expr/constr/CName.java:108— basex-core/src/main/java/org/basex/query/expr/constr/CName.java:108-116 | basex-core/src/main/java/org/basex/query/expr/ft/FTWeight.java:111-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) basex-core/src/main/java/org/basex/gui/view/map/SquarifiedAlgo.java:43— basex-core/src/main/java/org/basex/gui/view/map/SquarifiedAlgo.java:43-51 | basex-core/src/main/java/org/basex/gui/view/map/StripAlgo.java:43-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/gui/view/map/SquarifiedAlgo.java:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) basex-core/src/main/java/org/basex/query/expr/Except.java:102— basex-core/src/main/java/org/basex/query/expr/Except.java:102-109 | basex-core/src/main/java/org/basex/query/expr/Union.java:84-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/expr/Except.java:102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:274— basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:274-281 | basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:287-294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:379— basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:379-386 | basex-core/src/main/java/org/basex/query/util/fingertree/PartialInnerNode.java:75-82 — 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 `basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:379` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:334— basex-core/src/main/java/org/basex/query/value/array/BigArray.java:334-341 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:328-335 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/BigArray.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/BigArray.java:334` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:51— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:51-58 | basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:65-72 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:51` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:51— basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:51-58 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:65-72 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:51` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:156— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:156-163 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:156-163 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `right` to `Node<Value, Value>` in one and `Node<Item, Item>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) basex-core/src/main/java/org/basex/query/func/db/DbList.java:57— basex-core/src/main/java/org/basex/query/func/db/DbList.java:57-64 | basex-core/src/main/java/org/basex/query/func/db/DbListDetails.java:52-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) basex-core/src/main/java/org/basex/query/value/item/Str.java:141— basex-core/src/main/java/org/basex/query/value/item/Str.java:141-148 | basex-core/src/main/java/org/basex/query/value/item/Uri.java:117-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×9
Edited copy of a member (14 corresponding lines) basex-core/src/main/java/org/basex/query/value/node/DBNode.java:132— basex-core/src/main/java/org/basex/query/value/node/DBNode.java:132-145 | basex-core/src/main/java/org/basex/query/value/node/DBNode.java:148-161 — 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) basex-core/src/main/java/org/basex/util/ft/Tokenizer.java:89— basex-core/src/main/java/org/basex/util/ft/Tokenizer.java:89-102 | basex-core/src/main/java/org/basex/util/ft/Tokenizer.java:109-122 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnInnermost.java:16— basex-core/src/main/java/org/basex/query/func/fn/FnInnermost.java:16-29 | basex-core/src/main/java/org/basex/query/func/fn/FnOutermost.java:20-36 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) REDACTED:348— REDACTED:348-361 | REDACTED:375-390 — 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) basex-core/src/main/java/org/basex/query/func/fn/FnDuplicateValues.java:21— basex-core/src/main/java/org/basex/query/func/fn/FnDuplicateValues.java:21-34 | basex-core/src/main/java/org/basex/query/func/util/UtilValuesExcept.java:21-37 — 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) basex-core/src/main/java/org/basex/query/func/xquery/XQueryForkAny.java:37— basex-core/src/main/java/org/basex/query/func/xquery/XQueryForkAny.java:37-50 | basex-core/src/main/java/org/basex/query/func/xquery/XQueryForkJoin.java:40-56 — 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) basex-core/src/main/java/org/basex/query/func/fn/FnDropWhile.java:18— basex-core/src/main/java/org/basex/query/func/fn/FnDropWhile.java:18-37 | basex-core/src/main/java/org/basex/query/func/fn/FnTakeWhile.java:19-32 — 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) basex-core/src/main/java/org/basex/query/expr/index/RangeAccess.java:44— basex-core/src/main/java/org/basex/query/expr/index/RangeAccess.java:44-57 | basex-core/src/main/java/org/basex/query/expr/index/StringRangeAccess.java:44-57 — 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) basex-core/src/main/java/org/basex/io/random/DataAccess.java:457— basex-core/src/main/java/org/basex/io/random/DataAccess.java:457-470 | basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:517-530 — 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.
Change coupling: Function.java ↔ NSGlobal.java basex-core/src/main/java/org/basex/query/func/Function.java:1— `basex-core/src/main/java/org/basex/query/func/Function.java` and `basex-core/src/main/java/org/basex/query/util/NSGlobal.java` change together 63% of the time (12 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `1ada0eaa` [DEL] XQuery: Higher-Order Functions Module; `620291fc` [DEL] Obsolete code dropped; `0775b134` [MOD] XQuery: Keep prefixes of obsolete query modules to improve erro… — run `git show` on any of them.
Change coupling: editor.js ↔ js.js basex-modules/dba/src/main/resources/static/editor.js:1— `basex-modules/dba/src/main/resources/static/editor.js` and `basex-modules/dba/src/main/resources/static/js.js` change together 59% of the time (20 of the 34 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). Neither file is a module — they declare no import/export and are loaded together into one shared scope by a script tag or a bundle — so there is no dependency edge that COULD be declared between them, and this pass cannot tell a real relationship from a coincidence of release. Read the pair before acting: if one defines what the other uses through the shared global, that is the coupling, and making it explicit (a module boundary, or one named object they both go through) is what removes it; if they duplicate structure, extract the common part; if neither holds, the co-change is incidental and there is nothing to do. You can check this without leaving the row: of the 20 shared commits counted here, the most recent 3 are `6fb7364f` [MOD] DBA: Databases, Sessions, WebSockets (at that commit the files were still `basex-api/src/main/webapp/dba/static/editor.js` and `basex-api/src/main/webapp/dba/static/js.js`); `94adf47f` [MOD] DBA: merge editor.js into js.js (at that commit the files were still `basex-api/src/main/webapp/dba/static/editor.js` and `basex-api/src/main/webapp/dba/static/js.js`); `deb2db4b` [MOD] DBA: Layout (table → div) (at that commit the files were still `basex-api/src/main/webapp/dba/static/editor.js` and `basex-api/src/main/webapp/dba/static/js.js`) — run `git show` on any of them.
Change coupling: JobContext.java ↔ ClientListener.java basex-core/src/main/java/org/basex/core/jobs/JobContext.java:1— `basex-core/src/main/java/org/basex/core/jobs/JobContext.java` and `basex-core/src/main/java/org/basex/server/ClientListener.java` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `9cce8dd5` [MOD] Trace handling revised (unlimited output on command line); `ec58f490` [MOD] XQuery: Reduce excessive trace output per query; `30526bbe` [MIN] XQuery: FnTrace.trace moved to QueryContext — run `git show` on any of them.
Change coupling: FuncItem.java ↔ VarScope.java basex-core/src/main/java/org/basex/query/value/item/FuncItem.java:1— `basex-core/src/main/java/org/basex/query/value/item/FuncItem.java` and `basex-core/src/main/java/org/basex/query/var/VarScope.java` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `6cb6236c` [MOD] XQuery: maps & arrays, function coercion; `1386b8f3` [MOD] XQuery: fewer StaticContext references; `21746ddc` [MOD] Moved non-local bindings from `VarScope` to `Closure`. — run `git show` on any of them.
Change coupling: SearchContext.java ↔ TextEditor.java basex-core/src/main/java/org/basex/gui/text/SearchContext.java:1— `basex-core/src/main/java/org/basex/gui/text/SearchContext.java` and `basex-core/src/main/java/org/basex/gui/text/TextEditor.java` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `fd094f1d` [FIX] GUI: catch all changes of filter and search strings; `af11dabe` [MOD] XQuery, text editor: shortcuts, improved search&replace; `e2914c58` [MOD] GUI, editor: interrupt long-running regex searches (II) — run `git show` on any of them.
Change coupling: StaticFuncCall.java ↔ XQFunctionExpr.java basex-core/src/main/java/org/basex/query/func/StaticFuncCall.java:1— `basex-core/src/main/java/org/basex/query/func/StaticFuncCall.java` and `basex-core/src/main/java/org/basex/query/func/XQFunctionExpr.java` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `0fd8b00a` [MOD] Core: inline coerced function items, no wrapper; `c92bae3c` [MIN] XQuery: vacuous functions; `a7ccf890` [MOD] XQuery, abstract XQData class added — run `git show` on any of them.
Change coupling: IndexNames.java ↔ DiskValuesBuilder.java basex-core/src/main/java/org/basex/index/IndexNames.java:1— `basex-core/src/main/java/org/basex/index/IndexNames.java` and `basex-core/src/main/java/org/basex/index/value/DiskValuesBuilder.java` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `d49125bb` [MOD] CREATE DB: faster compression, index building; `5f4c0da9` [FIX] Core, index include names: separators, validation; `e0904228` [MIN] Index unifications: unit predicate, create flags — run `git show` on any of them.
Change coupling: Iter.java ↔ Seq.java basex-core/src/main/java/org/basex/query/iter/Iter.java:1— `basex-core/src/main/java/org/basex/query/iter/Iter.java` and `basex-core/src/main/java/org/basex/query/value/seq/Seq.java` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `1fc8174e` [ADD] XQuery: sequence builders for custom atomic types: initial capa…; `6f97d326` [MOD] XQuery: no traversal of value-based iterators; fewer stop checks; `ea554746` [MOD] XQuery: type propagation to iterator value — run `git show` on any of them.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×7
Focus outline removed in CSS without a :focus replacement basex-modules/webdav/src/main/resources/static/style.css:240— `textarea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement basex-modules/dba/src/main/resources/static/style.css:257— `input[type=checkbox]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement basex-modules/dba/src/main/resources/static/style.css:450— `textarea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement basex-modules/dba/src/main/resources/static/style.css:848— `body .cm-editor.cm-focused` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement basex-modules/dba/src/main/resources/static/style.css:1146— `dialog :not(button, input, select, textarea, a):focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement basex-modules/chat/src/main/resources/static/style.css:240— `textarea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement basex-api/src/main/webapp/static/style.css:239— `textarea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Duplicated block (10 lines × 2) basex-core/src/main/java/org/basex/build/xml/SAXHandler.java:140— basex-core/src/main/java/org/basex/build/xml/SAXHandler.java:140-149 | basex-core/src/main/java/org/basex/build/xml/XMLParser.java:198-207 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) basex-core/src/main/java/org/basex/core/cmd/AlterDB.java:36— basex-core/src/main/java/org/basex/core/cmd/AlterDB.java:36-45 | basex-core/src/main/java/org/basex/core/cmd/Copy.java:42-51 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `basex-core/src/main/java/org/basex/core/cmd/AlterDB.java:48` calls `close`, `pinned`, `error` and `basex-core/src/main/java/org/basex/core/cmd/Copy.java:53` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:76— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:76-85 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:76-85 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:76` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `siblings` to `Node<Value, Value>[]` in one and `Node<Item, Item>[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) basex-core/src/main/java/org/basex/util/http/Client.java:580— basex-core/src/main/java/org/basex/util/http/Client.java:580-589 | basex-core/src/main/java/org/basex/util/http/MediaType.java:138-147 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/util/http/Client.java:580` it begins part-way through the construct above it, so those 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) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:142— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:142-151 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:142-151 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:142` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `left` to `Node<Value, Value>` in one and `Node<Item, Item>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) basex-core/src/main/java/org/basex/query/value/node/GNode.java:251— basex-core/src/main/java/org/basex/query/value/node/GNode.java:251-260 | basex-core/src/main/java/org/basex/query/value/node/GNode.java:333-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/node/GNode.java:251` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:125— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:125-134 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:125-134 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `right` to `Node<Value, Value>` in one and `Node<Item, Item>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×6
Edited copy of a member (17 corresponding lines) basex-core/src/main/java/org/basex/util/Token.java:682— basex-core/src/main/java/org/basex/util/Token.java:682-698 | basex-core/src/main/java/org/basex/util/Token.java:706-723 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeBuilder.java:135— basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeBuilder.java:135-152 | basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeBuilder.java:158-174 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Calc.java:54— basex-core/src/main/java/org/basex/query/expr/Calc.java:54-74 | basex-core/src/main/java/org/basex/query/expr/Calc.java:129-145 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Except.java:82— basex-core/src/main/java/org/basex/query/expr/Except.java:82-98 | basex-core/src/main/java/org/basex/query/expr/Intersect.java:78-97 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnAllDifferent.java:40— basex-core/src/main/java/org/basex/query/func/fn/FnAllDifferent.java:40-56 | basex-core/src/main/java/org/basex/query/func/fn/FnAllEqual.java:43-62 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:304— basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:304-321 | basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:797-813 — 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 copy of a member (20 corresponding lines) · ×5
Edited copy of a member (20 corresponding lines) basex-core/src/main/java/org/basex/query/util/format/DecFormatter.java:193— basex-core/src/main/java/org/basex/query/util/format/DecFormatter.java:193-213 | basex-core/src/main/java/org/basex/query/util/format/IcuFormatter.java:281-300 — 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) basex-core/src/main/java/org/basex/query/util/collation/HtmlNoCaseCollation.java:28— basex-core/src/main/java/org/basex/query/util/collation/HtmlNoCaseCollation.java:28-47 | basex-core/src/main/java/org/basex/query/util/collation/UnicodeNoCaseCollation.java:22-44 — 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) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:164— basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:164-183 | basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:186-206 — 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) basex-core/src/main/java/org/basex/query/value/node/GNode.java:255— basex-core/src/main/java/org/basex/query/value/node/GNode.java:255-274 | basex-core/src/main/java/org/basex/query/value/node/GNode.java:337-357 — 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) basex-core/src/main/java/org/basex/query/value/node/DBNode.java:310— basex-core/src/main/java/org/basex/query/value/node/DBNode.java:310-330 | basex-core/src/main/java/org/basex/query/value/node/DBNode.java:367-386 — 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 (12 corresponding lines) · ×5
Edited copy of a member (12 corresponding lines) basex-core/src/main/java/org/basex/query/func/array/ArraySlice.java:17— basex-core/src/main/java/org/basex/query/func/array/ArraySlice.java:17-28 | basex-core/src/main/java/org/basex/query/func/fn/FnSlice.java:24-35 — 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) basex-core/src/main/java/org/basex/query/value/array/SmallArray.java:48— basex-core/src/main/java/org/basex/query/value/array/SmallArray.java:48-59 | basex-core/src/main/java/org/basex/query/value/seq/tree/SmallSeq.java:64-77 — 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) basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:35— basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:35-46 | basex-core/src/main/java/org/basex/query/expr/ft/FTOr.java:35-46 — 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) basex-core/src/main/java/org/basex/build/DiskBuilder.java:213— basex-core/src/main/java/org/basex/build/DiskBuilder.java:213-228 | basex-core/src/main/java/org/basex/data/DiskData.java:453-464 — 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) basex-core/src/main/java/org/basex/query/value/seq/Seq.java:73— basex-core/src/main/java/org/basex/query/value/seq/Seq.java:73-84 | basex-core/src/main/java/org/basex/query/value/seq/tree/SmallSeq.java:156-167 — 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 copies of one member (3 members, 8+ corresponding lines) · ×5
Edited copies of one member (3 members, 8+ corresponding lines) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:248— basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:248-256 | basex-core/src/main/java/org/basex/query/value/array/BigArray.java:385-392 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:69-76 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) basex-core/src/main/java/org/basex/query/value/item/DTDur.java:68— basex-core/src/main/java/org/basex/query/value/item/DTDur.java:68-76 | basex-core/src/main/java/org/basex/query/value/item/Dur.java:92-100 | basex-core/src/main/java/org/basex/query/value/item/YMDur.java:70-77 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) basex-core/src/main/java/org/basex/query/func/array/ArrayGet.java:30— basex-core/src/main/java/org/basex/query/func/array/ArrayGet.java:30-38 | basex-core/src/main/java/org/basex/query/func/array/ArrayItems.java:28-35 | basex-core/src/main/java/org/basex/query/func/map/MapItems.java:27-34 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) basex-core/src/main/java/org/basex/query/value/map/XQAtmValueMap.java:72— basex-core/src/main/java/org/basex/query/value/map/XQAtmValueMap.java:72-79 | basex-core/src/main/java/org/basex/query/value/map/XQIntValueMap.java:72-79 | basex-core/src/main/java/org/basex/query/value/map/XQStrValueMap.java:71-78 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) basex-core/src/main/java/org/basex/gui/text/Syntax.java:775— basex-core/src/main/java/org/basex/gui/text/Syntax.java:775-782 | basex-core/src/main/java/org/basex/query/func/StandardFunc.java:1269-1277 | basex-core/src/main/java/org/basex/query/func/java/JavaCall.java:634-644 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×5
Edited copies of one member (3 members, 7+ corresponding lines) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:863— basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:863-870 | basex-core/src/main/java/org/basex/query/value/array/TreeArray.java:51-57 | basex-core/src/main/java/org/basex/query/value/seq/tree/TreeSeq.java:119-125 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) basex-core/src/main/java/org/basex/query/func/crypto/CryptoDecrypt.java:15— basex-core/src/main/java/org/basex/query/func/crypto/CryptoDecrypt.java:15-21 | basex-core/src/main/java/org/basex/query/func/crypto/CryptoEncrypt.java:15-21 | basex-core/src/main/java/org/basex/query/func/crypto/CryptoHmac.java:15-22 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) basex-core/src/main/java/org/basex/query/QueryParser.java:1459— basex-core/src/main/java/org/basex/query/QueryParser.java:1459-1470 | basex-core/src/main/java/org/basex/query/QueryParser.java:2126-2132 | basex-core/src/main/java/org/basex/query/QueryParser.java:2139-2146 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) basex-core/src/main/java/org/basex/query/expr/Concat.java:31— basex-core/src/main/java/org/basex/query/expr/Concat.java:31-40 | basex-core/src/main/java/org/basex/query/func/fn/FnRemove.java:95-101 | basex-core/src/main/java/org/basex/query/func/fn/FnUpdate.java:326-336 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) basex-core/src/main/java/org/basex/query/util/hash/QNmSet.java:63— basex-core/src/main/java/org/basex/query/util/hash/QNmSet.java:63-69 | basex-core/src/main/java/org/basex/util/hash/IntSet.java:67-73 | basex-core/src/main/java/org/basex/util/hash/TokenSet.java:131-137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×4
Edited copy of a member (16 corresponding lines) basex-core/src/main/java/org/basex/query/func/xquery/XQueryForEach.java:22— basex-core/src/main/java/org/basex/query/func/xquery/XQueryForEach.java:22-39 | basex-core/src/main/java/org/basex/query/func/xquery/XQueryForkJoin.java:22-37 — 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) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:247— basex-core/src/main/java/org/basex/gui/text/TextEditor.java:247-262 | basex-core/src/main/java/org/basex/gui/text/TextEditor.java:268-284 — 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) basex-core/src/main/java/org/basex/gui/dialog/DialogLine.java:31— basex-core/src/main/java/org/basex/gui/dialog/DialogLine.java:31-47 | basex-core/src/main/java/org/basex/gui/dialog/DialogPass.java:30-45 — 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) basex-core/src/main/java/org/basex/query/expr/Expr.java:180— basex-core/src/main/java/org/basex/query/expr/Expr.java:180-195 | basex-core/src/main/java/org/basex/query/func/DynFuncCall.java:237-253 — 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 (15 corresponding lines) · ×4
Edited copy of a member (15 corresponding lines) basex-core/src/main/java/org/basex/core/cmd/BinaryGet.java:32— basex-core/src/main/java/org/basex/core/cmd/BinaryGet.java:32-48 | basex-core/src/main/java/org/basex/core/cmd/Get.java:29-43 — 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) basex-core/src/main/java/org/basex/io/out/DataOutput.java:136— basex-core/src/main/java/org/basex/io/out/DataOutput.java:136-151 | basex-core/src/main/java/org/basex/io/random/DataAccess.java:769-783 — 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) basex-core/src/main/java/org/basex/util/http/Client.java:67— basex-core/src/main/java/org/basex/util/http/Client.java:67-81 | basex-core/src/main/java/org/basex/util/http/Client.java:93-108 — 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) basex-core/src/main/java/org/basex/query/func/fn/FnData.java:57— basex-core/src/main/java/org/basex/query/func/fn/FnData.java:57-71 | basex-core/src/main/java/org/basex/query/func/fn/FnString.java:69-83 — 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 copies of one member (3 members, 3+ corresponding lines) · ×4
Edited copies of one member (3 members, 3+ corresponding lines) basex-core/src/main/java/org/basex/query/expr/ButWith.java:120— basex-core/src/main/java/org/basex/query/expr/ButWith.java:120-122 | basex-core/src/main/java/org/basex/query/expr/If.java:238-240 | basex-core/src/main/java/org/basex/query/expr/ft/FTMildNot.java:102-104 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) basex-core/src/main/java/org/basex/query/value/item/QNm.java:399— basex-core/src/main/java/org/basex/query/value/item/QNm.java:399-401 | basex-core/src/main/java/org/basex/query/value/node/FAttr.java:70-72 | basex-core/src/main/java/org/basex/query/value/node/FDoc.java:129-131 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnCount.java:44— basex-core/src/main/java/org/basex/query/func/fn/FnCount.java:44-47 | basex-core/src/main/java/org/basex/query/func/fn/FnEmpty.java:37-40 | basex-core/src/main/java/org/basex/query/func/util/UtilCountWithin.java:65-67 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) basex-core/src/main/java/org/basex/query/expr/path/IterLastStep.java:48— basex-core/src/main/java/org/basex/query/expr/path/IterLastStep.java:48-50 | basex-core/src/main/java/org/basex/query/expr/path/IterPosStep.java:80-82 | basex-core/src/main/java/org/basex/query/expr/path/IterStep.java:45-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
IntList.sort (cyclomatic 20) basex-core/src/main/java/org/basex/util/list/IntList.java:461— IntList.sort has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (IntList.sort, IntList.sort) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
IntList.sort (cyclomatic 20) basex-core/src/main/java/org/basex/util/list/IntList.java:522— IntList.sort has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (IntList.sort, IntList.sort) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
IntList.sort (cyclomatic 20) basex-core/src/main/java/org/basex/util/list/IntList.java:583— IntList.sort has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (IntList.sort, IntList.sort) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
IntList.sort (cognitive 47) basex-core/src/main/java/org/basex/util/list/IntList.java:461— IntList.sort has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (24 pts), ternaries 3 (13 pts), loops 5 (10 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (IntList.sort, IntList.sort) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
IntList.sort (cognitive 47) basex-core/src/main/java/org/basex/util/list/IntList.java:522— IntList.sort has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (24 pts), ternaries 3 (13 pts), loops 5 (10 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (IntList.sort, IntList.sort) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
IntList.sort (cognitive 47) basex-core/src/main/java/org/basex/util/list/IntList.java:583— IntList.sort has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (24 pts), ternaries 3 (13 pts), loops 5 (10 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (IntList.sort, IntList.sort) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×3
Edited copy of a member (29 corresponding lines) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:95— basex-core/src/main/java/org/basex/query/value/array/BigArray.java:95-123 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:79-109 — 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) basex-core/src/main/java/org/basex/query/expr/Except.java:101— basex-core/src/main/java/org/basex/query/expr/Except.java:101-129 | basex-core/src/main/java/org/basex/query/expr/Union.java:83-111 — 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) basex-api/src/main/ruby/QueryBindExample.rb:9— basex-api/src/main/ruby/QueryBindExample.rb:9-38 | basex-api/src/main/ruby/QueryExample.rb:8-36 — 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 (25 corresponding lines) · ×3
Edited copy of a member (25 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Calc.java:26— basex-core/src/main/java/org/basex/query/expr/Calc.java:26-50 | basex-core/src/main/java/org/basex/query/expr/Calc.java:100-125 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Intersect.java:37— basex-core/src/main/java/org/basex/query/expr/Intersect.java:37-69 | basex-core/src/main/java/org/basex/query/expr/Union.java:38-62 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) basex-core/src/main/java/org/basex/query/value/array/TreeArrayBuilder.java:33— basex-core/src/main/java/org/basex/query/value/array/TreeArrayBuilder.java:33-62 | basex-core/src/main/java/org/basex/query/value/seq/tree/TreeSeqBuilder.java:79-103 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×3
Edited copy of a member (21 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnGenerate.java:42— basex-core/src/main/java/org/basex/query/func/fn/FnGenerate.java:42-64 | basex-core/src/main/java/org/basex/query/func/fn/FnTransitiveClosure.java:44-64 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) basex-core/src/main/java/org/basex/util/http/Client.java:569— basex-core/src/main/java/org/basex/util/http/Client.java:569-589 | basex-core/src/main/java/org/basex/util/http/MediaType.java:125-147 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) basex-core/src/main/java/org/basex/query/expr/CachedMap.java:28— basex-core/src/main/java/org/basex/query/expr/CachedMap.java:28-52 | basex-core/src/main/java/org/basex/query/expr/IterMap.java:96-116 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×3
Edited copies of one member (3 members, 12+ corresponding lines) basex-core/src/main/java/org/basex/query/func/array/ArrayFoldLeft.java:18— basex-core/src/main/java/org/basex/query/func/array/ArrayFoldLeft.java:18-29 | basex-core/src/main/java/org/basex/query/func/array/ArrayFoldRight.java:19-31 | basex-core/src/main/java/org/basex/query/func/fn/FnFoldLeft.java:32-43 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnFilter.java:34— basex-core/src/main/java/org/basex/query/func/fn/FnFilter.java:34-47 | basex-core/src/main/java/org/basex/query/func/fn/FnForEach.java:35-46 | basex-core/src/main/java/org/basex/query/func/fn/FnIndexWhere.java:34-46 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) basex-core/src/main/java/org/basex/util/list/BoolList.java:81— basex-core/src/main/java/org/basex/util/list/BoolList.java:81-92 | basex-core/src/main/java/org/basex/util/list/IntList.java:91-102 | basex-core/src/main/java/org/basex/util/list/ObjectList.java:126-137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×3
Edited copies of one member (3 members, 4+ corresponding lines) basex-core/src/main/java/org/basex/query/expr/path/CachedPath.java:105— basex-core/src/main/java/org/basex/query/expr/path/CachedPath.java:105-108 | basex-core/src/main/java/org/basex/query/expr/path/IterPath.java:39-42 | basex-core/src/main/java/org/basex/query/expr/path/UnorderedPath.java:32-35 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) basex-core/src/main/java/org/basex/query/func/bit/BitCount.java:16— basex-core/src/main/java/org/basex/query/func/bit/BitCount.java:16-19 | basex-core/src/main/java/org/basex/query/func/bit/BitNot.java:19-22 | basex-core/src/main/java/org/basex/query/func/bit/BitUnsigned.java:19-23 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) basex-core/src/main/java/org/basex/query/expr/Cast.java:71— basex-core/src/main/java/org/basex/query/expr/Cast.java:71-74 | basex-core/src/main/java/org/basex/query/expr/Castable.java:61-64 | basex-core/src/main/java/org/basex/query/expr/Instance.java:129-132 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (12 lines × 2) basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java:219— basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java:219-230 | basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java:253-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java:219` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:284— basex-core/src/main/java/org/basex/query/value/array/BigArray.java:284-295 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:278-289 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/BigArray.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/BigArray.java:284` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:351— basex-core/src/main/java/org/basex/query/value/array/BigArray.java:351-362 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:345-356 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/BigArray.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/BigArray.java:351` it begins part-way through the construct above it, so those 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) basex-core/src/main/java/org/basex/query/expr/index/StringRangeAccess.java:78— basex-core/src/main/java/org/basex/query/expr/index/StringRangeAccess.java:78-88 | basex-core/src/main/java/org/basex/query/expr/index/ValueAccess.java:215-225 — 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 `basex-core/src/main/java/org/basex/query/expr/index/StringRangeAccess.java:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) basex-core/src/main/java/org/basex/util/list/IntList.java:230— basex-core/src/main/java/org/basex/util/list/IntList.java:230-240 | basex-core/src/main/java/org/basex/util/list/LongList.java:110-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:59— basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:59-69 | basex-core/src/main/java/org/basex/query/expr/ft/FTOr.java:59-69 — 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 `basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 3) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:866— basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:866-870 | basex-core/src/main/java/org/basex/query/value/array/TreeArray.java:53-57 | basex-core/src/main/java/org/basex/query/value/seq/tree/TreeSeq.java:121-125 — 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 `basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:866` 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, `basex-core/src/main/java/org/basex/query/value/seq/tree/TreeSeq.java:106` calls `prepend` and `basex-core/src/main/java/org/basex/query/value/array/TreeArray.java:38` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) basex-core/src/main/java/org/basex/query/value/map/XQAtmIntMap.java:48— basex-core/src/main/java/org/basex/query/value/map/XQAtmIntMap.java:48-52 | basex-core/src/main/java/org/basex/query/value/map/XQIntMap.java:48-52 | basex-core/src/main/java/org/basex/query/value/map/XQStrIntMap.java:46-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (5 lines × 3) basex-core/src/main/java/org/basex/query/value/map/XQAtmStrMap.java:48— basex-core/src/main/java/org/basex/query/value/map/XQAtmStrMap.java:48-52 | basex-core/src/main/java/org/basex/query/value/map/XQIntStrMap.java:48-52 | basex-core/src/main/java/org/basex/query/value/map/XQStrMap.java:46-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×2
Edited copy of a member (31 corresponding lines) basex-core/src/main/java/org/basex/query/util/collation/BaseXCollation.java:37— basex-core/src/main/java/org/basex/query/util/collation/BaseXCollation.java:37-68 | basex-core/src/main/java/org/basex/query/util/collation/UCACollation.java:67-97 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnReverse.java:24— basex-core/src/main/java/org/basex/query/func/fn/FnReverse.java:24-60 | basex-core/src/main/java/org/basex/query/func/fn/FnTail.java:23-53 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×2
Edited copy of a member (34 corresponding lines) basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:57— basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:57-93 | basex-core/src/main/java/org/basex/query/expr/ft/FTOr.java:57-90 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) basex-examples/src/main/java/org/basex/examples/local/QueryCollection.java:18— basex-examples/src/main/java/org/basex/examples/local/QueryCollection.java:18-55 | basex-examples/src/main/java/org/basex/examples/local/WikiExample.java:19-52 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×2
Edited copy of a member (19 corresponding lines) basex-core/src/main/java/org/basex/query/func/db/DbContentType.java:20— basex-core/src/main/java/org/basex/query/func/db/DbContentType.java:20-42 | basex-core/src/main/java/org/basex/query/func/db/DbType.java:19-37 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) basex-core/src/main/java/org/basex/query/iter/BasicIter.java:47— basex-core/src/main/java/org/basex/query/iter/BasicIter.java:47-65 | basex-core/src/main/java/org/basex/query/iter/BasicNodeIter.java:40-60 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×2
Edited copies of one member (4 members, 8+ corresponding lines) basex-core/src/main/java/org/basex/data/Data.java:1183— basex-core/src/main/java/org/basex/data/Data.java:1183-1190 | basex-core/src/main/java/org/basex/data/Data.java:1202-1212 | basex-core/src/main/java/org/basex/data/Data.java:1220-1228 | basex-core/src/main/java/org/basex/data/Data.java:1239-1249 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:354— basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:354-361 | basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:372-379 | basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:390-397 | basex-core/src/main/java/org/basex/query/expr/CalcOpt.java:408-416 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 11+ corresponding lines) · ×2
Edited copies of one member (7 members, 11+ corresponding lines) basex-core/src/main/java/org/basex/query/value/map/XQAtmIntMap.java:65— basex-core/src/main/java/org/basex/query/value/map/XQAtmIntMap.java:65-76 | basex-core/src/main/java/org/basex/query/value/map/XQAtmStrMap.java:65-75 | basex-core/src/main/java/org/basex/query/value/map/XQIntMap.java:65-75 | basex-core/src/main/java/org/basex/query/value/map/XQIntStrMap.java:65-76 | basex-core/src/main/java/org/basex/query/value/map/XQStrDblMap.java:65-76 | basex-core/src/main/java/org/basex/query/value/map/XQStrIntMap.java:63-74 | basex-core/src/main/java/org/basex/query/value/map/XQStrMap.java:63-73 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
Edited copies of one member (7 members, 11+ corresponding lines) basex-core/src/main/java/org/basex/util/list/BoolList.java:37— basex-core/src/main/java/org/basex/util/list/BoolList.java:37-47 | basex-core/src/main/java/org/basex/util/list/ByteList.java:39-49 | basex-core/src/main/java/org/basex/util/list/DoubleList.java:37-47 | basex-core/src/main/java/org/basex/util/list/FloatList.java:37-47 | basex-core/src/main/java/org/basex/util/list/IntList.java:47-57 | basex-core/src/main/java/org/basex/util/list/LongList.java:37-47 | basex-core/src/main/java/org/basex/util/list/ShortList.java:37-47 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×2
Edited copies of one member (3 members, 9+ corresponding lines) basex-core/src/main/java/org/basex/util/list/ByteList.java:121— basex-core/src/main/java/org/basex/util/list/ByteList.java:121-129 | basex-core/src/main/java/org/basex/util/list/IntList.java:267-275 | basex-core/src/main/java/org/basex/util/list/ObjectList.java:246-254 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) basex-core/src/main/java/org/basex/query/value/node/DBNode.java:320— basex-core/src/main/java/org/basex/query/value/node/DBNode.java:320-328 | basex-core/src/main/java/org/basex/query/value/node/DBNode.java:376-384 | basex-core/src/main/java/org/basex/query/value/node/DBNode.java:508-516 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 6+ corresponding lines) · ×2
Edited copies of one member (7 members, 6+ corresponding lines) basex-core/src/main/java/org/basex/query/value/map/XQAtmIntMap.java:47— basex-core/src/main/java/org/basex/query/value/map/XQAtmIntMap.java:47-52 | basex-core/src/main/java/org/basex/query/value/map/XQAtmStrMap.java:47-52 | basex-core/src/main/java/org/basex/query/value/map/XQIntMap.java:47-52 | basex-core/src/main/java/org/basex/query/value/map/XQIntStrMap.java:47-52 | basex-core/src/main/java/org/basex/query/value/map/XQStrDblMap.java:47-52 | basex-core/src/main/java/org/basex/query/value/map/XQStrIntMap.java:45-50 | basex-core/src/main/java/org/basex/query/value/map/XQStrMap.java:45-50 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
Edited copies of one member (7 members, 6+ corresponding lines) basex-core/src/main/java/org/basex/util/list/BoolList.java:141— basex-core/src/main/java/org/basex/util/list/BoolList.java:141-146 | basex-core/src/main/java/org/basex/util/list/ByteList.java:110-115 | basex-core/src/main/java/org/basex/util/list/DoubleList.java:89-94 | basex-core/src/main/java/org/basex/util/list/FloatList.java:89-94 | basex-core/src/main/java/org/basex/util/list/IntList.java:218-223 | basex-core/src/main/java/org/basex/util/list/LongList.java:89-94 | basex-core/src/main/java/org/basex/util/list/ShortList.java:89-94 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×2
Edited copies of one member (4 members, 7+ corresponding lines) basex-api/src/main/java/org/basex/query/func/request/RequestSetAttribute.java:16— basex-api/src/main/java/org/basex/query/func/request/RequestSetAttribute.java:16-22 | basex-api/src/main/java/org/basex/query/func/session/SessionSet.java:15-22 | basex-api/src/main/java/org/basex/query/func/sessions/SessionsSet.java:16-23 | basex-api/src/main/java/org/basex/query/func/ws/WsSet.java:16-23 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 7+ corresponding lines) basex-api/src/main/java/org/basex/query/func/session/SessionGet.java:15— basex-api/src/main/java/org/basex/query/func/session/SessionGet.java:15-21 | basex-api/src/main/java/org/basex/query/func/sessions/SessionsGet.java:16-22 | basex-api/src/main/java/org/basex/query/func/ws/WsGet.java:16-24 | basex-core/src/main/java/org/basex/query/func/map/MapGet.java:19-25 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×2
Edited copies of one member (3 members, 6+ corresponding lines) basex-core/src/main/java/org/basex/query/func/array/ArraySplit.java:55— basex-core/src/main/java/org/basex/query/func/array/ArraySplit.java:55-60 | basex-core/src/main/java/org/basex/query/func/fn/FnTrunk.java:129-134 | basex-core/src/main/java/org/basex/query/func/map/MapEntries.java:41-46 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnDistinctValues.java:36— basex-core/src/main/java/org/basex/query/func/fn/FnDistinctValues.java:36-41 | basex-core/src/main/java/org/basex/query/func/fn/FnDuplicateValues.java:27-32 | basex-core/src/main/java/org/basex/query/func/util/UtilValuesExcept.java:30-35 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×2
Edited copies of one member (4 members, 4+ corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnDayFromDate.java:17— basex-core/src/main/java/org/basex/query/func/fn/FnDayFromDate.java:17-20 | basex-core/src/main/java/org/basex/query/func/fn/FnMonthFromDate.java:17-20 | basex-core/src/main/java/org/basex/query/func/fn/FnTimezoneFromDate.java:17-20 | basex-core/src/main/java/org/basex/query/func/fn/FnYearFromDate.java:17-20 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnHoursFromTime.java:17— basex-core/src/main/java/org/basex/query/func/fn/FnHoursFromTime.java:17-20 | basex-core/src/main/java/org/basex/query/func/fn/FnMinutesFromTime.java:17-20 | basex-core/src/main/java/org/basex/query/func/fn/FnSecondsFromTime.java:17-20 | basex-core/src/main/java/org/basex/query/func/fn/FnTimezoneFromTime.java:17-20 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×2
Edited copies of one member (3 members, 5+ corresponding lines) basex-core/src/main/java/org/basex/query/expr/Except.java:132— basex-core/src/main/java/org/basex/query/expr/Except.java:132-136 | basex-core/src/main/java/org/basex/query/expr/Intersect.java:129-133 | basex-core/src/main/java/org/basex/query/expr/Union.java:135-139 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) basex-core/src/main/java/org/basex/util/hash/TokenDblMap.java:55— basex-core/src/main/java/org/basex/util/hash/TokenDblMap.java:55-59 | basex-core/src/main/java/org/basex/util/hash/TokenIntMap.java:95-99 | basex-core/src/main/java/org/basex/util/hash/TokenObjectMap.java:106-110 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (7–8 lines × 2) basex-core/src/main/java/org/basex/query/expr/ft/FTWildcard.java:75— basex-core/src/main/java/org/basex/query/expr/ft/FTWildcard.java:75-81 | basex-core/src/main/java/org/basex/query/expr/ft/FTWildcard.java:82-89 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7–8 lines × 2) basex-core/src/main/java/org/basex/query/func/file/FileReadFn.java:44— basex-core/src/main/java/org/basex/query/func/file/FileReadFn.java:44-51 | basex-core/src/main/java/org/basex/query/func/fn/FnUnparsedTextAvailable.java:84-90 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 3) basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:112— basex-core/src/main/java/org/basex/query/expr/ft/FTAnd.java:112-120 | basex-core/src/main/java/org/basex/query/expr/ft/FTMildNot.java:91-99 | basex-core/src/main/java/org/basex/query/expr/ft/FTOr.java:107-115 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) basex-examples/src/main/java/org/basex/examples/server/ServerCollection.java:24— basex-examples/src/main/java/org/basex/examples/server/ServerCollection.java:24-32 | basex-examples/src/main/java/org/basex/examples/server/ServerCommands.java:20-28 | basex-examples/src/main/java/org/basex/examples/server/ServerQueries.java:18-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `basex-examples/src/main/java/org/basex/examples/server/ServerCollection.java:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) basex-core/src/main/java/org/basex/query/value/seq/BytSeq.java:120— basex-core/src/main/java/org/basex/query/value/seq/BytSeq.java:120-124 | basex-core/src/main/java/org/basex/query/value/seq/IntSeq.java:112-116 | basex-core/src/main/java/org/basex/query/value/seq/LongSeq.java:113-117 | basex-core/src/main/java/org/basex/query/value/seq/ShrSeq.java:112-116 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `values` to `byte[]` in one and `int[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 4) basex-examples/src/main/java/org/basex/examples/rest/RESTDelete.java:34— basex-examples/src/main/java/org/basex/examples/rest/RESTDelete.java:34-38 | basex-examples/src/main/java/org/basex/examples/rest/RESTGet.java:33-37 | basex-examples/src/main/java/org/basex/examples/rest/RESTPost.java:40-44 | basex-examples/src/main/java/org/basex/examples/rest/RESTPut.java:34-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `basex-examples/src/main/java/org/basex/examples/rest/RESTDelete.java:39` calls `body` and `basex-examples/src/main/java/org/basex/examples/rest/RESTPut.java:39` 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.
R10 · Code Duplication· Duplicated block with local edits (8 matched lines × 2 locations) · ×2
Duplicated block with local edits (8 matched lines × 2 locations) basex-api/src/main/javascript/CreateExample.mjs:7— basex-api/src/main/javascript/CreateExample.mjs:7 · basex-api/src/main/javascript/QueryBindExample.mjs:7 — the two spans are one implementation copied and then locally edited — 51 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (8 matched lines × 2 locations) basex-api/src/main/javascript/CreateExample.mjs:7— basex-api/src/main/javascript/CreateExample.mjs:7 · basex-api/src/main/javascript/QueryExample.mjs:7 — the two spans are one implementation copied and then locally edited — 51 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark basex-examples/src/main/resources/html/news.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC4 · Keyboard semantics· Anchor without href · ×1
Anchor without href basex-modules/chat/src/main/resources/static/chat.js:131— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Low contrast colour pair in CSS (4.4:1) basex-modules/dba/src/main/resources/static/style.css:1361— `:is(button.collapse, button.run):hover` sets color: #C33 on background-color: #EEE — 4.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
XMLParser.command (cyclomatic 109) basex-core/src/main/java/org/basex/core/parse/XMLParser.java:63— XMLParser.command has cyclomatic complexity 109 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SyntaxXQuery.scan (cyclomatic 69) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:915— SyntaxXQuery.scan has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
js.shortcuts (cyclomatic 66) basex-modules/dba/src/main/resources/static/js.js:1256— js.shortcuts has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SimpleMap.merge (cyclomatic 65) basex-core/src/main/java/org/basex/query/expr/SimpleMap.java:120— SimpleMap.merge has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UCAOptions.get (cyclomatic 63) basex-core/src/main/java/org/basex/query/util/collation/UCAOptions.java:57— UCAOptions.get has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TextPanel.keyPressed (cyclomatic 60) basex-core/src/main/java/org/basex/gui/text/TextPanel.java:877— TextPanel.keyPressed has cyclomatic complexity 60 (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.
XNode.deepEqual (cyclomatic 56) basex-core/src/main/java/org/basex/query/value/node/XNode.java:106— XNode.deepEqual has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MetaData.read (cyclomatic 56) basex-core/src/main/java/org/basex/data/MetaData.java:551— MetaData.read has cyclomatic complexity 56 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Filter.optimize (cyclomatic 55) basex-core/src/main/java/org/basex/query/expr/Filter.java:104— Filter.optimize 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.
RegExLexer.escape (cyclomatic 53) basex-core/src/main/java/org/basex/query/util/regex/parse/RegExLexer.java:187— RegExLexer.escape has cyclomatic complexity 53 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FnLoadXQueryModule.value (cyclomatic 51) basex-core/src/main/java/org/basex/query/func/fn/FnLoadXQueryModule.java:42— FnLoadXQueryModule.value has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MapRenderer.computeToolTip (cyclomatic 51) basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:449— MapRenderer.computeToolTip has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Range.optimizePos (cyclomatic 49) basex-core/src/main/java/org/basex/query/expr/Range.java:135— Range.optimizePos has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TextRenderer.write (cyclomatic 49) basex-core/src/main/java/org/basex/gui/text/TextRenderer.java:790— TextRenderer.write has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FnSubsequence.opt (cyclomatic 48) basex-core/src/main/java/org/basex/query/func/fn/FnSubsequence.java:276— FnSubsequence.opt has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CmpG.optimize (cyclomatic 48) basex-core/src/main/java/org/basex/query/expr/CmpG.java:59— CmpG.optimize has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RegExLexer.normal (cyclomatic 48) basex-core/src/main/java/org/basex/query/util/regex/parse/RegExLexer.java:100— RegExLexer.normal has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Pos.get (cyclomatic 47) basex-core/src/main/java/org/basex/query/expr/Pos.java:46— Pos.get has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IndexRewrite.get (cyclomatic 45) basex-core/src/main/java/org/basex/query/util/index/IndexRewrite.java:55— IndexRewrite.get has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
QueryParser.numericLiteral (cyclomatic 45) basex-core/src/main/java/org/basex/query/QueryParser.java:3130— QueryParser.numericLiteral has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SyntaxMD.mode (cyclomatic 45) basex-core/src/main/java/org/basex/gui/text/SyntaxMD.java:82— SyntaxMD.mode has cyclomatic complexity 45 (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.
Formatter.component (cyclomatic 44) basex-core/src/main/java/org/basex/query/util/format/Formatter.java:207— Formatter.component 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.
QueryParser.dirElement (cyclomatic 43) basex-core/src/main/java/org/basex/query/QueryParser.java:3451— QueryParser.dirElement has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FormatterFR.word (cyclomatic 42) basex-core/src/main/java/org/basex/query/util/format/FormatterFR.java:93— FormatterFR.word has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DecFormatter.format (cyclomatic 41) basex-core/src/main/java/org/basex/query/util/format/DecFormatter.java:527— DecFormatter.format has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FuncItem.fold (cyclomatic 41) basex-core/src/main/java/org/basex/query/value/item/FuncItem.java:374— FuncItem.fold has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
QueryJob.run (cyclomatic 41) basex-core/src/main/java/org/basex/core/jobs/QueryJob.java:245— QueryJob.run has cyclomatic complexity 41 (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.
RestXqFunction.parseAnnotations (cyclomatic 40) basex-api/src/main/java/org/basex/http/restxq/RestXqFunction.java:113— RestXqFunction.parseAnnotations has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FnPath.value (cyclomatic 40) basex-core/src/main/java/org/basex/query/func/fn/FnPath.java:42— FnPath.value has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Cmp.optBoolean (cyclomatic 40) basex-core/src/main/java/org/basex/query/expr/Cmp.java:246— Cmp.optBoolean has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FnReplace.value (cyclomatic 39) basex-core/src/main/java/org/basex/query/func/fn/FnReplace.java:37— FnReplace.value has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
QueryParser.ftMatchOption (cyclomatic 39) basex-core/src/main/java/org/basex/query/QueryParser.java:4848— QueryParser.ftMatchOption has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Inspection.node (cyclomatic 39) basex-core/src/main/java/org/basex/data/Inspection.java:187— Inspection.node has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SyntaxJS.mode (cyclomatic 39) basex-core/src/main/java/org/basex/gui/text/SyntaxJS.java:63— SyntaxJS.mode has cyclomatic complexity 39 (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.
GUI.execute (cyclomatic 39) basex-core/src/main/java/org/basex/gui/GUI.java:353— GUI.execute has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GreekStemmer.rule0 (cyclomatic 39) basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:81— GreekStemmer.rule0 has cyclomatic complexity 39 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EnglishStemmer.s (cyclomatic 38) basex-core/src/main/java/org/basex/util/ft/EnglishStemmer.java:114— EnglishStemmer.s has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FnParseUri.value (cyclomatic 37) basex-core/src/main/java/org/basex/query/func/fn/FnParseUri.java:57— FnParseUri.value has cyclomatic complexity 37 (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.
Unit.test (cyclomatic 37) basex-core/src/main/java/org/basex/query/func/unit/Unit.java:74— Unit.test has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FTWords.indexAccessible (cyclomatic 37) basex-core/src/main/java/org/basex/query/expr/ft/FTWords.java:427— FTWords.indexAccessible has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
XMLScanner.markupDecl (cyclomatic 37) basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:808— XMLScanner.markupDecl has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Path.iterative (cyclomatic 36) basex-core/src/main/java/org/basex/query/expr/path/Path.java:520— Path.iterative 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.
SyntaxMarkup.mode (cyclomatic 36) basex-core/src/main/java/org/basex/gui/text/SyntaxMarkup.java:141— SyntaxMarkup.mode has cyclomatic complexity 36 (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.
InfoView.setInfo (cyclomatic 36) basex-core/src/main/java/org/basex/gui/view/info/InfoView.java:162— InfoView.setInfo 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.
DecFormatter.checkSyntax (cyclomatic 35) basex-core/src/main/java/org/basex/query/util/format/DecFormatter.java:293— DecFormatter.checkSyntax has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NSNames.resolve (cyclomatic 35) basex-core/src/main/java/org/basex/data/NSNames.java:63— NSNames.resolve has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ColognePhonetic.encode (cyclomatic 35) basex-core/src/main/java/org/basex/util/similarity/ColognePhonetic.java:45— ColognePhonetic.encode has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
XQueryEval.eval (cyclomatic 34) basex-core/src/main/java/org/basex/query/func/xquery/XQueryEval.java:59— XQueryEval.eval 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.
TextEditor.add (cyclomatic 34) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:1051— TextEditor.add 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.
JsonW3XmlSerializer.node (cyclomatic 34) basex-core/src/main/java/org/basex/io/serial/json/JsonW3XmlSerializer.java:43— JsonW3XmlSerializer.node 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.
Arith.optimize (cyclomatic 33) basex-core/src/main/java/org/basex/query/expr/Arith.java:42— Arith.optimize 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.
Cmp.optCount (cyclomatic 33) basex-core/src/main/java/org/basex/query/expr/Cmp.java:327— Cmp.optCount 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.
Formatter.format (cyclomatic 33) basex-core/src/main/java/org/basex/gui/text/Formatter.java:118— Formatter.format 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.
JsonParser.number (cyclomatic 33) basex-core/src/main/java/org/basex/io/parse/json/JsonParser.java:286— JsonParser.number has cyclomatic complexity 33 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
JavaCall.convert (cyclomatic 32) basex-core/src/main/java/org/basex/query/func/java/JavaCall.java:147— JavaCall.convert 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.
Step.nodes (cyclomatic 32) basex-core/src/main/java/org/basex/query/expr/path/Step.java:332— Step.nodes 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.
Set.mergePaths (cyclomatic 32) basex-core/src/main/java/org/basex/query/expr/Set.java:169— Set.mergePaths 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.
IndexInfo.type (cyclomatic 32) basex-core/src/main/java/org/basex/query/util/index/IndexInfo.java:86— IndexInfo.type 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.
DialogManage.action (cyclomatic 32) basex-core/src/main/java/org/basex/gui/dialog/DialogManage.java:137— DialogManage.action 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.
CsvSerializer.field (cyclomatic 32) basex-core/src/main/java/org/basex/io/serial/csv/CsvSerializer.java:147— CsvSerializer.field 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.
Serializer.node (cyclomatic 32) basex-core/src/main/java/org/basex/io/serial/Serializer.java:549— Serializer.node 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.
IndonesianStemmer.remFirstPrefix (cyclomatic 32) basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:200— IndonesianStemmer.remFirstPrefix has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BaseX.<init> (cyclomatic 32) REDACTED:54— BaseX.<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.
CmpR.merge (cyclomatic 31) basex-core/src/main/java/org/basex/query/expr/CmpR.java:261— CmpR.merge 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.
SyntaxXQuery.code (cyclomatic 31) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:348— SyntaxXQuery.code 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.
PlotView.paintComponent (cyclomatic 31) basex-core/src/main/java/org/basex/gui/view/plot/PlotView.java:270— PlotView.paintComponent 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.
TableContent.paintComponent (cyclomatic 31) basex-core/src/main/java/org/basex/gui/view/table/TableContent.java:44— TableContent.paintComponent 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.
FnItemsAt.opt (cyclomatic 30) basex-core/src/main/java/org/basex/query/func/fn/FnItemsAt.java:137— FnItemsAt.opt 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.
JavaCall.toValue (cyclomatic 30) basex-core/src/main/java/org/basex/query/func/java/JavaCall.java:241— JavaCall.toValue 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.
Arr.optimizeEbv (cyclomatic 30) basex-core/src/main/java/org/basex/query/expr/Arr.java:189— Arr.optimizeEbv 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.
DecFormatter.analyze (cyclomatic 30) basex-core/src/main/java/org/basex/query/util/format/DecFormatter.java:394— DecFormatter.analyze 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.
DataFTBuilder.build (cyclomatic 30) basex-core/src/main/java/org/basex/query/util/DataFTBuilder.java:79— DataFTBuilder.build 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.
JsonParser.string (cyclomatic 30) basex-core/src/main/java/org/basex/io/parse/json/JsonParser.java:345— JsonParser.string 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.
Options.assign (cyclomatic 30) basex-core/src/main/java/org/basex/util/options/Options.java:907— Options.assign 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.
DigitalSignature.generate (cyclomatic 29) REDACTED:103— DigitalSignature.generate has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
InspectStaticContext.value (cyclomatic 29) basex-core/src/main/java/org/basex/query/func/inspect/InspectStaticContext.java:24— InspectStaticContext.value has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Unfold.count (cyclomatic 29) basex-core/src/main/java/org/basex/query/expr/Unfold.java:233— Unfold.count has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BigArray.subArr (cyclomatic 29) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:250— BigArray.subArr has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BigSeq.subSeq (cyclomatic 29) basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:242— BigSeq.subSeq has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditorView.run (cyclomatic 29) basex-core/src/main/java/org/basex/gui/view/editor/EditorView.java:607— EditorView.run has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MapRenderer.drawSentence (cyclomatic 29) basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:255— MapRenderer.drawSentence has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlotView.drawAxis (cyclomatic 29) basex-core/src/main/java/org/basex/gui/view/plot/PlotView.java:446— PlotView.drawAxis has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TableHeader.mouseDragged (cyclomatic 29) basex-core/src/main/java/org/basex/gui/view/table/TableHeader.java:203— TableHeader.mouseDragged has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FnFoldLeft.flatten (cyclomatic 28) basex-core/src/main/java/org/basex/query/func/fn/FnFoldLeft.java:187— FnFoldLeft.flatten has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Constr.add (cyclomatic 28) basex-core/src/main/java/org/basex/query/expr/constr/Constr.java:102— Constr.add 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.
GFLWOR.optimizeCond (cyclomatic 28) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:747— GFLWOR.optimizeCond 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.
Formatter.number (cyclomatic 28) basex-core/src/main/java/org/basex/query/util/format/Formatter.java:668— Formatter.number 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.
IntFormat.<init> (cyclomatic 28) basex-core/src/main/java/org/basex/query/util/format/IntFormat.java:25— IntFormat.<init> 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.
Formatter.whitespace (cyclomatic 28) basex-core/src/main/java/org/basex/gui/text/Formatter.java:334— Formatter.whitespace 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.
SyntaxXQuery.mode (cyclomatic 28) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:295— SyntaxXQuery.mode has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
JapaneseTokenizer.moreWC (cyclomatic 28) basex-core/src/main/java/org/basex/util/ft/JapaneseTokenizer.java:199— JapaneseTokenizer.moreWC 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.
RestXqResponse.serialize (cyclomatic 27) basex-api/src/main/java/org/basex/http/restxq/RestXqResponse.java:74— RestXqResponse.serialize 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.
Path.mergeStep (cyclomatic 27) basex-core/src/main/java/org/basex/query/expr/path/Path.java:971— Path.mergeStep 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.
Cmp.countRange (cyclomatic 27) basex-core/src/main/java/org/basex/query/expr/Cmp.java:484— Cmp.countRange has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
FormatterDE.word (cyclomatic 27) basex-core/src/main/java/org/basex/query/util/format/FormatterDE.java:122— FormatterDE.word 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.
SeqType.coerce (cyclomatic 27) basex-core/src/main/java/org/basex/query/value/type/SeqType.java:413— SeqType.coerce 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.
ShapeType.intersect (cyclomatic 27) basex-core/src/main/java/org/basex/query/value/type/ShapeType.java:463— ShapeType.intersect 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.
Inspection.<init> (cyclomatic 27) basex-core/src/main/java/org/basex/data/Inspection.java:131— Inspection.<init> has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TreeView.paintComponent (cyclomatic 27) basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:142— TreeView.paintComponent 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.
WesternTokenizer.more (cyclomatic 27) basex-core/src/main/java/org/basex/util/ft/WesternTokenizer.java:134— WesternTokenizer.more 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.
Options.assign (cyclomatic 27) basex-core/src/main/java/org/basex/util/options/Options.java:1074— Options.assign 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.
workspace.workspaceKeys (cyclomatic 27) basex-modules/dba/src/main/resources/static/workspace.js:885— workspace.workspaceKeys has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
FnFoldLeft.optType (cyclomatic 26) basex-core/src/main/java/org/basex/query/func/fn/FnFoldLeft.java:124— FnFoldLeft.optType 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.
FnUpdate.change (cyclomatic 26) basex-core/src/main/java/org/basex/query/func/fn/FnUpdate.java:272— FnUpdate.change 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.
CElem.optimize (cyclomatic 26) basex-core/src/main/java/org/basex/query/expr/constr/CElem.java:73— CElem.optimize 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.
CMap.optimize (cyclomatic 26) basex-core/src/main/java/org/basex/query/expr/constr/CMap.java:40— CMap.optimize 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.
Path.cleanSteps (cyclomatic 26) basex-core/src/main/java/org/basex/query/expr/path/Path.java:421— Path.cleanSteps 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.
CmpG.optArith (cyclomatic 26) basex-core/src/main/java/org/basex/query/expr/CmpG.java:223— CmpG.optArith 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.
Preds.flattenEbv (cyclomatic 26) basex-core/src/main/java/org/basex/query/expr/Preds.java:273— Preds.flattenEbv 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.
SyntaxXQuery.indent (cyclomatic 26) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:1118— SyntaxXQuery.indent 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.
TextEditor.enclosing (cyclomatic 26) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:2101— TextEditor.enclosing 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.
ExploreArea.query (cyclomatic 26) basex-core/src/main/java/org/basex/gui/view/explore/ExploreArea.java:204— ExploreArea.query 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.
GreekStemmer.rule21 (cyclomatic 26) basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:932— GreekStemmer.rule21 has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
FnMin.opt (cyclomatic 25) basex-core/src/main/java/org/basex/query/func/fn/FnMin.java:103— FnMin.opt 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.
PlanFn.plan (cyclomatic 25) basex-core/src/main/java/org/basex/query/func/fn/PlanFn.java:231— PlanFn.plan 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.
GFLWOR.rewrite (cyclomatic 25) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:248— GFLWOR.rewrite 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.
CmpR.get (cyclomatic 25) basex-core/src/main/java/org/basex/query/expr/CmpR.java:122— CmpR.get has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
GroupScanner.groupInfo (cyclomatic 25) basex-core/src/main/java/org/basex/query/util/regex/RegExpr.java:207— GroupScanner.groupInfo 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.
TypedKeys.comparator (cyclomatic 25) basex-core/src/main/java/org/basex/query/util/TypedKeys.java:31— TypedKeys.comparator 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.
XQArray.toJava (cyclomatic 25) basex-core/src/main/java/org/basex/query/value/array/XQArray.java:403— XQArray.toJava has cyclomatic complexity 25 (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.
SeqType.cast (cyclomatic 25) basex-core/src/main/java/org/basex/query/value/type/SeqType.java:206— SeqType.cast 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.
QueryParser.flwor (cyclomatic 25) basex-core/src/main/java/org/basex/query/QueryParser.java:1500— QueryParser.flwor has cyclomatic complexity 25 (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.
QueryJob.<init> (cyclomatic 25) basex-core/src/main/java/org/basex/core/jobs/QueryJob.java:62— QueryJob.<init> 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.
FolderView.keyPressed (cyclomatic 25) basex-core/src/main/java/org/basex/gui/view/folder/FolderView.java:395— FolderView.keyPressed has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FnEmpty.opt (cyclomatic 24) basex-core/src/main/java/org/basex/query/func/fn/FnEmpty.java:43— FnEmpty.opt 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.
FnHead.opt (cyclomatic 24) basex-core/src/main/java/org/basex/query/func/fn/FnHead.java:30— FnHead.opt has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
JavaCall.type (cyclomatic 24) basex-core/src/main/java/org/basex/query/func/java/JavaCall.java:651— JavaCall.type 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.
DynFuncCall.optimize (cyclomatic 24) basex-core/src/main/java/org/basex/query/func/DynFuncCall.java:81— DynFuncCall.optimize 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.
ThesAccessor.source (cyclomatic 24) basex-core/src/main/java/org/basex/query/expr/ft/ThesAccessor.java:141— ThesAccessor.source 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.
CmpG.optPred (cyclomatic 24) basex-core/src/main/java/org/basex/query/expr/CmpG.java:581— CmpG.optPred 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.
Preds.optimize (cyclomatic 24) basex-core/src/main/java/org/basex/query/expr/Preds.java:110— Preds.optimize 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.
FormatParser.presentation (cyclomatic 24) basex-core/src/main/java/org/basex/query/util/format/FormatParser.java:64— FormatParser.presentation 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.
Formatter.formatZone (cyclomatic 24) basex-core/src/main/java/org/basex/query/util/format/Formatter.java:493— Formatter.formatZone 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.
QueryParser.itemType (cyclomatic 24) basex-core/src/main/java/org/basex/query/QueryParser.java:4256— QueryParser.itemType 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.
FnBuildUri.value (cyclomatic 23) basex-core/src/main/java/org/basex/query/func/fn/FnBuildUri.java:19— FnBuildUri.value 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.
FnParseInteger.value (cyclomatic 23) basex-core/src/main/java/org/basex/query/func/fn/FnParseInteger.java:21— FnParseInteger.value has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MapToElement.qName (cyclomatic 23) basex-core/src/main/java/org/basex/query/func/fn/MapToElement.java:712— MapToElement.qName 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.
Step.optimize (cyclomatic 23) basex-core/src/main/java/org/basex/query/expr/path/Step.java:209— Step.optimize has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Replace.lazyReplace (cyclomatic 23) basex-core/src/main/java/org/basex/query/up/atomic/Replace.java:75— Replace.lazyReplace 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.
DeepTree.insert (cyclomatic 23) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:292— DeepTree.insert 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.
DecFormatter.<init> (cyclomatic 23) basex-core/src/main/java/org/basex/query/util/format/DecFormatter.java:87— DecFormatter.<init> 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.
IndexInfo.create (cyclomatic 23) basex-core/src/main/java/org/basex/query/util/index/IndexInfo.java:207— IndexInfo.create 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.
SeqType.coerceAtomic (cyclomatic 23) basex-core/src/main/java/org/basex/query/value/type/SeqType.java:478— SeqType.coerceAtomic has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
QueryParser.functionTest (cyclomatic 23) basex-core/src/main/java/org/basex/query/QueryParser.java:4351— QueryParser.functionTest 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.
XMLParser.parseElement (cyclomatic 23) basex-core/src/main/java/org/basex/build/xml/XMLParser.java:121— XMLParser.parseElement 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.
Optimize.optimize (cyclomatic 23) basex-core/src/main/java/org/basex/core/cmd/Optimize.java:102— Optimize.optimize 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.
Locking.acquire (cyclomatic 23) basex-core/src/main/java/org/basex/core/locks/Locking.java:97— Locking.acquire 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.
Formatter.lengths (cyclomatic 23) basex-core/src/main/java/org/basex/gui/text/Formatter.java:226— Formatter.lengths 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.
MapView.paintComponent (cyclomatic 23) basex-core/src/main/java/org/basex/gui/view/map/MapView.java:272— MapView.paintComponent 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.
JsonNodeSerializer.finishOpen (cyclomatic 23) basex-core/src/main/java/org/basex/io/serial/json/JsonNodeSerializer.java:168— JsonNodeSerializer.finishOpen 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.
JsonW3XmlSerializer.isNumber (cyclomatic 23) basex-core/src/main/java/org/basex/io/serial/json/JsonW3XmlSerializer.java:133— JsonW3XmlSerializer.isNumber 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.
GermanStemmer.subst (cyclomatic 23) basex-core/src/main/java/org/basex/util/ft/GermanStemmer.java:48— GermanStemmer.subst 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.
IntList.sort (cyclomatic 23) basex-core/src/main/java/org/basex/util/list/IntList.java:399— IntList.sort 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.
RestXqFunction.error (cyclomatic 22) basex-api/src/main/java/org/basex/http/restxq/RestXqFunction.java:511— RestXqFunction.error 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.
MapToElement.matches (cyclomatic 22) basex-core/src/main/java/org/basex/query/func/fn/MapToElement.java:593— MapToElement.matches has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
GFLWOR.inlineForLet (cyclomatic 22) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:489— GFLWOR.inlineForLet 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.
CmpIR.get (cyclomatic 22) basex-core/src/main/java/org/basex/query/expr/CmpIR.java:71— CmpIR.get has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
TypeCheck.optimize (cyclomatic 22) basex-core/src/main/java/org/basex/query/expr/TypeCheck.java:53— TypeCheck.optimize 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.
DeepTree.slice (cyclomatic 22) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:618— DeepTree.slice has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
QueryParser.annotations (cyclomatic 22) basex-core/src/main/java/org/basex/query/QueryParser.java:601— QueryParser.annotations 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.
QueryParser.prolog1 (cyclomatic 22) basex-core/src/main/java/org/basex/query/QueryParser.java:487— QueryParser.prolog1 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.
BaseXFileChooser.selectAll (cyclomatic 22) basex-core/src/main/java/org/basex/gui/layout/BaseXFileChooser.java:114— BaseXFileChooser.selectAll 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.
SyntaxMD.inline (cyclomatic 22) basex-core/src/main/java/org/basex/gui/text/SyntaxMD.java:336— SyntaxMD.inline 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.
TextEditor.comment (cyclomatic 22) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:529— TextEditor.comment 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.
CsvParser.parse (cyclomatic 22) basex-core/src/main/java/org/basex/io/parse/csv/CsvParser.java:76— CsvParser.parse 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.
XMLToken.decode (cyclomatic 22) basex-core/src/main/java/org/basex/util/XMLToken.java:345— XMLToken.decode 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.
FnMin.minmax (cyclomatic 21) basex-core/src/main/java/org/basex/query/func/fn/FnMin.java:44— FnMin.minmax 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.
FnSlice.opt (cyclomatic 21) basex-core/src/main/java/org/basex/query/func/fn/FnSlice.java:38— FnSlice.opt 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.
FnSum.opt (cyclomatic 21) basex-core/src/main/java/org/basex/query/func/fn/FnSum.java:75— FnSum.opt 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.
FTWildcard.parse (cyclomatic 21) basex-core/src/main/java/org/basex/query/expr/ft/FTWildcard.java:45— FTWildcard.parse 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.
CmpR.indexAccessible (cyclomatic 21) basex-core/src/main/java/org/basex/query/expr/CmpR.java:333— CmpR.indexAccessible has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PkgValidator.availVersion (cyclomatic 21) basex-core/src/main/java/org/basex/query/util/pkg/PkgValidator.java:109— PkgValidator.availVersion 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.
XQMap.instanceOf (cyclomatic 21) basex-core/src/main/java/org/basex/query/value/map/XQMap.java:343— XQMap.instanceOf has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
QueryParser.entity (cyclomatic 21) basex-core/src/main/java/org/basex/query/QueryParser.java:5245— QueryParser.entity 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.
SAXWrapper.parse (cyclomatic 21) basex-core/src/main/java/org/basex/build/xml/SAXWrapper.java:50— SAXWrapper.parse 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.
AQuery.run (cyclomatic 21) basex-core/src/main/java/org/basex/core/cmd/AQuery.java:61— AQuery.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.
Data.insert (cyclomatic 21) basex-core/src/main/java/org/basex/data/Data.java:949— Data.insert 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.
SyntaxXQuery.completions (cyclomatic 21) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:492— SyntaxXQuery.completions has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Stats.add (cyclomatic 21) basex-core/src/main/java/org/basex/index/stats/Stats.java:108— Stats.add 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.
JsonW3XmlSerializer.unescape (cyclomatic 21) basex-core/src/main/java/org/basex/io/serial/json/JsonW3XmlSerializer.java:305— JsonW3XmlSerializer.unescape 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.
BaseXHTTP.parseArgs (cyclomatic 20) REDACTED:258— BaseXHTTP.parseArgs has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DbNew.fillXmlInput (cyclomatic 20) basex-core/src/main/java/org/basex/query/func/db/DbNew.java:93— DbNew.fillXmlInput 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.
FnSum.sum (cyclomatic 20) basex-core/src/main/java/org/basex/query/func/fn/FnSum.java:235— FnSum.sum 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.
SaxonTransform.executable (cyclomatic 20) basex-core/src/main/java/org/basex/query/func/fn/SaxonTransform.java:247— SaxonTransform.executable 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.
JavaCall.get (cyclomatic 20) basex-core/src/main/java/org/basex/query/func/java/JavaCall.java:330— JavaCall.get 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.
1.next (cyclomatic 20) basex-core/src/main/java/org/basex/query/expr/ft/FTWords.java:167— 1.next 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.
Linear.normalize (cyclomatic 20) basex-core/src/main/java/org/basex/query/expr/Linear.java:50— Linear.normalize 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.
DeepEqual.equal (cyclomatic 20) basex-core/src/main/java/org/basex/query/util/DeepEqual.java:114— DeepEqual.equal 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.
TransferVisitor.value (cyclomatic 20) basex-core/src/main/java/org/basex/query/util/TransferVisitor.java:92— TransferVisitor.value 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.
Dbl.round (cyclomatic 20) basex-core/src/main/java/org/basex/query/value/item/Dbl.java:118— Dbl.round has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ValueBuilder.add (cyclomatic 20) basex-core/src/main/java/org/basex/query/value/ValueBuilder.java:68— ValueBuilder.add 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.
QueryError.typeError (cyclomatic 20) basex-core/src/main/java/org/basex/query/QueryError.java:1835— QueryError.typeError 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.
QueryParser.forClause (cyclomatic 20) basex-core/src/main/java/org/basex/query/QueryParser.java:1624— QueryParser.forClause 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.
QueryParser.ftSelection (cyclomatic 20) basex-core/src/main/java/org/basex/query/QueryParser.java:4599— QueryParser.ftSelection 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.
QueryResources.collection (cyclomatic 20) basex-core/src/main/java/org/basex/query/QueryResources.java:274— QueryResources.collection has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Inspection.name (cyclomatic 20) basex-core/src/main/java/org/basex/data/Inspection.java:262— Inspection.name 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.
DialogProps.action (cyclomatic 20) basex-core/src/main/java/org/basex/gui/dialog/DialogProps.java:275— DialogProps.action 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.
SearchContext.normalize (cyclomatic 20) basex-core/src/main/java/org/basex/gui/text/SearchContext.java:99— SearchContext.normalize 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.
TextPanel.mousePressed (cyclomatic 20) basex-core/src/main/java/org/basex/gui/text/TextPanel.java:738— TextPanel.mousePressed 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.
MapView.keyPressed (cyclomatic 20) basex-core/src/main/java/org/basex/gui/view/map/MapView.java:497— MapView.keyPressed 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.
Serializer.node (cyclomatic 20) basex-core/src/main/java/org/basex/io/serial/Serializer.java:663— Serializer.node 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.
IOFile.normalize (cyclomatic 20) basex-core/src/main/java/org/basex/io/IOFile.java:944— IOFile.normalize 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.
UserInfo.digest (cyclomatic 20) basex-core/src/main/java/org/basex/util/http/UserInfo.java:120— UserInfo.digest 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.
RestXqFunction.bind (cyclomatic 19) basex-api/src/main/java/org/basex/http/restxq/RestXqFunction.java:216— RestXqFunction.bind has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FnFoot.opt (cyclomatic 19) basex-core/src/main/java/org/basex/query/func/fn/FnFoot.java:50— FnFoot.opt has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FnLowest.opt (cyclomatic 19) basex-core/src/main/java/org/basex/query/func/fn/FnLowest.java:74— FnLowest.opt 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.
FnSum.linear (cyclomatic 19) basex-core/src/main/java/org/basex/query/func/fn/FnSum.java:140— FnSum.linear has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
XQDoc.parse (cyclomatic 19) basex-core/src/main/java/org/basex/query/func/inspect/XQDoc.java:43— XQDoc.parse has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
GFLWOR.posToPred (cyclomatic 19) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:830— GFLWOR.posToPred 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.
CmpG.mergeEbv (cyclomatic 19) basex-core/src/main/java/org/basex/query/expr/CmpG.java:506— CmpG.mergeEbv has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CmpSR.merge (cyclomatic 19) basex-core/src/main/java/org/basex/query/expr/CmpSR.java:98— CmpSR.merge has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
If.opt (cyclomatic 19) basex-core/src/main/java/org/basex/query/expr/If.java:121— If.opt 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.
Linear.compare (cyclomatic 19) basex-core/src/main/java/org/basex/query/expr/Linear.java:95— Linear.compare has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Switch.opt (cyclomatic 19) basex-core/src/main/java/org/basex/query/expr/Switch.java:118— Switch.opt 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.
Unfold.iterate (cyclomatic 19) basex-core/src/main/java/org/basex/query/expr/Unfold.java:84— Unfold.iterate 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.
Insert.value (cyclomatic 19) basex-core/src/main/java/org/basex/query/up/expr/Insert.java:52— Insert.value 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.
QueryContext.cast (cyclomatic 19) basex-core/src/main/java/org/basex/query/QueryContext.java:919— QueryContext.cast 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.
QueryParser.simpleNodeTest (cyclomatic 19) basex-core/src/main/java/org/basex/query/QueryParser.java:2763— QueryParser.simpleNodeTest 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.
QueryParser.skipExprContent (cyclomatic 19) basex-core/src/main/java/org/basex/query/QueryParser.java:3693— QueryParser.skipExprContent 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.
XMLScanner.ref (cyclomatic 19) basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:495— XMLScanner.ref 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.
Data.replace (cyclomatic 19) basex-core/src/main/java/org/basex/data/Data.java:790— Data.replace has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SearchBar.<init> (cyclomatic 19) basex-core/src/main/java/org/basex/gui/text/SearchBar.java:82— SearchBar.<init> has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SyntaxMD.marker (cyclomatic 19) basex-core/src/main/java/org/basex/gui/text/SyntaxMD.java:210— SyntaxMD.marker 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.
SyntaxXQuery.definition (cyclomatic 19) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:564— SyntaxXQuery.definition 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.
TextEditor.sort (cyclomatic 19) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:882— TextEditor.sort 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.
EditorView.confirm (cyclomatic 19) basex-core/src/main/java/org/basex/gui/view/editor/EditorView.java:1184— EditorView.confirm 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.
TreeView.keyPressed (cyclomatic 19) basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:1024— TreeView.keyPressed 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.
Client.send (cyclomatic 19) basex-core/src/main/java/org/basex/util/http/Client.java:189— Client.send has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BaseX.parseArgs (cyclomatic 19) REDACTED:191— BaseX.parseArgs 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.
Mail.send (cyclomatic 19) basex-modules/mail/src/main/java/org/basex/modules/Mail.java:62— Mail.send has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DbCounts.tests (cyclomatic 18) basex-core/src/main/java/org/basex/query/func/db/DbCounts.java:92— DbCounts.tests 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.
FileCopy.relocate (cyclomatic 18) basex-core/src/main/java/org/basex/query/func/file/FileCopy.java:34— FileCopy.relocate 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.
FnMin.monotonic (cyclomatic 18) basex-core/src/main/java/org/basex/query/func/fn/FnMin.java:163— FnMin.monotonic 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.
FnSchemaType.annotate (cyclomatic 18) basex-core/src/main/java/org/basex/query/func/fn/FnSchemaType.java:41— FnSchemaType.annotate 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.
MapToElement.open (cyclomatic 18) basex-core/src/main/java/org/basex/query/func/fn/MapToElement.java:357— MapToElement.open 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.
Path.children (cyclomatic 18) basex-core/src/main/java/org/basex/query/expr/path/Path.java:745— Path.children 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.
Arr.rewrite (cyclomatic 18) basex-core/src/main/java/org/basex/query/expr/Arr.java:287— Arr.rewrite 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.
3.eval (cyclomatic 18) basex-core/src/main/java/org/basex/query/expr/Calc.java:169— 3.eval 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.
List.toRange (cyclomatic 18) basex-core/src/main/java/org/basex/query/expr/List.java:117— List.toRange 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.
Typeswitch.optimize (cyclomatic 18) basex-core/src/main/java/org/basex/query/expr/Typeswitch.java:60— Typeswitch.optimize 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.
Replace.value (cyclomatic 18) basex-core/src/main/java/org/basex/query/up/expr/Replace.java:44— Replace.value 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.
InnerNode.insert (cyclomatic 18) basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:71— InnerNode.insert 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.
InnerNode.remove (cyclomatic 18) basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:199— InnerNode.remove 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.
DateFormat.<init> (cyclomatic 18) basex-core/src/main/java/org/basex/query/util/format/DateFormat.java:29— DateFormat.<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.
Dec.round (cyclomatic 18) basex-core/src/main/java/org/basex/query/value/item/Dec.java:131— Dec.round 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.
XQMap.deepEqual (cyclomatic 18) basex-core/src/main/java/org/basex/query/value/map/XQMap.java:630— XQMap.deepEqual 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.
RangeSeq.optimizePos (cyclomatic 18) basex-core/src/main/java/org/basex/query/value/seq/RangeSeq.java:168— RangeSeq.optimizePos 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.
FuncType.intersect (cyclomatic 18) basex-core/src/main/java/org/basex/query/value/type/FuncType.java:208— FuncType.intersect 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.
QueryParser.stringConstructor (cyclomatic 18) basex-core/src/main/java/org/basex/query/QueryParser.java:3398— QueryParser.stringConstructor 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.
Data.indexPaths (cyclomatic 18) basex-core/src/main/java/org/basex/data/Data.java:655— Data.indexPaths 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.
TextEditor.splitLines (cyclomatic 18) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:2003— TextEditor.splitLines has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MapRenderer.drawText (cyclomatic 18) basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:77— MapRenderer.drawText 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.
ViewContainer.calc (cyclomatic 18) basex-core/src/main/java/org/basex/gui/view/ViewContainer.java:236— ViewContainer.calc 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.
1.next (cyclomatic 18) basex-core/src/main/java/org/basex/index/value/SegmentedValues.java:266— 1.next 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.
CsvParser.record (cyclomatic 18) basex-core/src/main/java/org/basex/io/parse/csv/CsvParser.java:159— CsvParser.record 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.
JsonW3XmlSerializer.escape (cyclomatic 18) basex-core/src/main/java/org/basex/io/serial/json/JsonW3XmlSerializer.java:272— JsonW3XmlSerializer.escape has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
MarkupSerializer.<init> (cyclomatic 18) basex-core/src/main/java/org/basex/io/serial/MarkupSerializer.java:70— MarkupSerializer.<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.
GreekStemmer.rule8 (cyclomatic 18) basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:417— GreekStemmer.rule8 has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Client.writePayload (cyclomatic 18) basex-core/src/main/java/org/basex/util/http/Client.java:643— Client.writePayload 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.
logs.logEntries (cyclomatic 18) basex-modules/dba/src/main/resources/static/logs.js:18— logs.logEntries has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, 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.
RestXqResponse.build (cyclomatic 17) basex-api/src/main/java/org/basex/http/restxq/RestXqResponse.java:181— RestXqResponse.build 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.
MapToElement.members (cyclomatic 17) basex-core/src/main/java/org/basex/query/func/fn/MapToElement.java:246— MapToElement.members 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.
SaxonTransform.node (cyclomatic 17) basex-core/src/main/java/org/basex/query/func/fn/SaxonTransform.java:447— SaxonTransform.node has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
PlainDoc.function (cyclomatic 17) basex-core/src/main/java/org/basex/query/func/inspect/PlainDoc.java:98— PlainDoc.function 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.
UtilCountWithin.opt (cyclomatic 17) basex-core/src/main/java/org/basex/query/func/util/UtilCountWithin.java:70— UtilCountWithin.opt 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.
GFLWOR.unusedVars (cyclomatic 17) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:402— GFLWOR.unusedVars 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.
Path.get (cyclomatic 17) basex-core/src/main/java/org/basex/query/expr/path/Path.java:77— Path.get 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.
Path.optimize (cyclomatic 17) basex-core/src/main/java/org/basex/query/expr/path/Path.java:176— Path.optimize has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
1.eval (cyclomatic 17) basex-core/src/main/java/org/basex/query/expr/Calc.java:25— 1.eval 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.
SimpleMap.optimize (cyclomatic 17) basex-core/src/main/java/org/basex/query/expr/SimpleMap.java:58— SimpleMap.optimize 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.
SimplePos.mergeEbv (cyclomatic 17) basex-core/src/main/java/org/basex/query/expr/SimplePos.java:118— SimplePos.mergeEbv 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.
NodeUpdateComparator.compare (cyclomatic 17) basex-core/src/main/java/org/basex/query/up/NodeUpdateComparator.java:78— NodeUpdateComparator.compare has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GNodeBuilder.sort (cyclomatic 17) basex-core/src/main/java/org/basex/query/util/list/GNodeBuilder.java:180— GNodeBuilder.sort 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.
ANum.compare (cyclomatic 17) basex-core/src/main/java/org/basex/query/value/item/ANum.java:196— ANum.compare 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.
Collector.collect (cyclomatic 17) basex-core/src/main/java/org/basex/query/value/type/RecordType.java:264— Collector.collect 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.
QueryParser.castTarget (cyclomatic 17) basex-core/src/main/java/org/basex/query/QueryParser.java:4150— QueryParser.castTarget 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.
QueryParser.declareExtension (cyclomatic 17) basex-core/src/main/java/org/basex/query/QueryParser.java:1255— QueryParser.declareExtension 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.
QueryParser.primary (cyclomatic 17) basex-core/src/main/java/org/basex/query/QueryParser.java:2898— QueryParser.primary has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
QueryParser.prolog2 (cyclomatic 17) basex-core/src/main/java/org/basex/query/QueryParser.java:543— QueryParser.prolog2 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.
CreateDB.run (cyclomatic 17) basex-core/src/main/java/org/basex/core/cmd/CreateDB.java:45— CreateDB.run has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BaseXDSlider.keyPressed (cyclomatic 17) basex-core/src/main/java/org/basex/gui/layout/BaseXDSlider.java:141— BaseXDSlider.keyPressed 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.
TextPanel.pointer (cyclomatic 17) basex-core/src/main/java/org/basex/gui/text/TextPanel.java:670— TextPanel.pointer 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.
MapRenderer.drawToolTip (cyclomatic 17) basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:634— MapRenderer.drawToolTip 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.
ProjectFilter.replace (cyclomatic 17) basex-core/src/main/java/org/basex/gui/view/project/ProjectFilter.java:293— ProjectFilter.replace has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TreeView.drawRectangle (cyclomatic 17) basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:331— TreeView.drawRectangle 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.
SegmentedValues.iter (cyclomatic 17) basex-core/src/main/java/org/basex/index/value/SegmentedValues.java:176— SegmentedValues.iter 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.
ClientListener.query (cyclomatic 17) basex-core/src/main/java/org/basex/server/ClientListener.java:384— ClientListener.query 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.
Payload.extractPart (cyclomatic 17) basex-core/src/main/java/org/basex/util/http/Payload.java:210— Payload.extractPart 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.
IntList.sort (cyclomatic 17) basex-core/src/main/java/org/basex/util/list/IntList.java:281— IntList.sort 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.
Levenshtein.distance (cyclomatic 17) basex-core/src/main/java/org/basex/util/similarity/Levenshtein.java:177— Levenshtein.distance 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.
Token.normalize (cyclomatic 17) basex-core/src/main/java/org/basex/util/Token.java:1296— Token.normalize 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.
Token.number (cyclomatic 17) basex-core/src/main/java/org/basex/util/Token.java:606— Token.number 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.
Token.toInt (cyclomatic 17) basex-core/src/main/java/org/basex/util/Token.java:706— Token.toInt has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (Token.toLong) 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.
Token.toLong (cyclomatic 17) basex-core/src/main/java/org/basex/util/Token.java:682— Token.toLong has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (Token.toInt) 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.
XMLToken.isNCStartChar (cyclomatic 17) basex-core/src/main/java/org/basex/util/XMLToken.java:148— XMLToken.isNCStartChar has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Sftp.connect (cyclomatic 17) basex-modules/sftp/src/main/java/org/basex/modules/Sftp.java:94— Sftp.connect has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RestXqServlet.run (cyclomatic 16) basex-api/src/main/java/org/basex/http/restxq/RestXqServlet.java:25— RestXqServlet.run has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BaseXHTTP.<init> (cyclomatic 16) REDACTED:70— BaseXHTTP.<init> 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.
FnReplicate.opt (cyclomatic 16) basex-core/src/main/java/org/basex/query/func/fn/FnReplicate.java:119— FnReplicate.opt 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.
FnSort.opt (cyclomatic 16) basex-core/src/main/java/org/basex/query/func/fn/FnSort.java:19— FnSort.opt 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.
FnSubstring.opt (cyclomatic 16) basex-core/src/main/java/org/basex/query/func/fn/FnSubstring.java:33— FnSubstring.opt 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.
FnUpdate.value (cyclomatic 16) basex-core/src/main/java/org/basex/query/func/fn/FnUpdate.java:44— FnUpdate.value 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.
ParseFn.doc (cyclomatic 16) basex-core/src/main/java/org/basex/query/func/fn/ParseFn.java:113— ParseFn.doc 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.
PlanType.get (cyclomatic 16) basex-core/src/main/java/org/basex/query/func/fn/PlanFn.java:110— PlanType.get 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.
JobListDetails.value (cyclomatic 16) basex-core/src/main/java/org/basex/query/func/job/JobListDetails.java:24— JobListDetails.value 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.
StringClosest.value (cyclomatic 16) basex-core/src/main/java/org/basex/query/func/string/StringClosest.java:46— StringClosest.value 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.
Closure.optimize (cyclomatic 16) basex-core/src/main/java/org/basex/query/func/Closure.java:174— Closure.optimize 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.
FTWords.contains (cyclomatic 16) basex-core/src/main/java/org/basex/query/expr/ft/FTWords.java:328— FTWords.contains 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.
Path.axis (cyclomatic 16) basex-core/src/main/java/org/basex/query/expr/path/Path.java:621— Path.axis 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.
Path.toUnion (cyclomatic 16) basex-core/src/main/java/org/basex/query/expr/path/Path.java:845— Path.toUnion 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.
2.eval (cyclomatic 16) basex-core/src/main/java/org/basex/query/expr/Calc.java:99— 2.eval 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.
4.eval (cyclomatic 16) basex-core/src/main/java/org/basex/query/expr/Calc.java:234— 4.eval 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.
FingerTreeIterator.init (cyclomatic 16) basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:100— FingerTreeIterator.init 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.
Dtm.buildUnchecked (cyclomatic 16) basex-core/src/main/java/org/basex/query/value/item/Dtm.java:183— Dtm.buildUnchecked 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.
QueryParser.attributeValue (cyclomatic 16) basex-core/src/main/java/org/basex/query/QueryParser.java:3609— QueryParser.attributeValue 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.
QueryParser.axisStep (cyclomatic 16) basex-core/src/main/java/org/basex/query/QueryParser.java:2671— QueryParser.axisStep 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.
QueryParser.check (cyclomatic 16) basex-core/src/main/java/org/basex/query/QueryParser.java:376— QueryParser.check 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.
QueryParser.labeledRecordTypeDecl (cyclomatic 16) basex-core/src/main/java/org/basex/query/QueryParser.java:1169— QueryParser.labeledRecordTypeDecl 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.
JsonParserOptions.check (cyclomatic 16) basex-core/src/main/java/org/basex/build/json/JsonParserOptions.java:85— JsonParserOptions.check 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.
XMLParser.parse (cyclomatic 16) basex-core/src/main/java/org/basex/build/xml/XMLParser.java:69— XMLParser.parse 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.
Add.build (cyclomatic 16) basex-core/src/main/java/org/basex/core/cmd/Add.java:72— Add.build 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.
TextEditor.call (cyclomatic 16) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:668— TextEditor.call 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.
TextEditor.closeElem (cyclomatic 16) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:1203— TextEditor.closeElem 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.
FTFuzzy.offsets (cyclomatic 16) basex-core/src/main/java/org/basex/index/ft/FTFuzzy.java:95— FTFuzzy.offsets has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
IdPreMap.delete (cyclomatic 16) basex-core/src/main/java/org/basex/index/IdPreMap.java:370— IdPreMap.delete 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.
SegmentedIndex.merge (cyclomatic 16) basex-core/src/main/java/org/basex/index/SegmentedIndex.java:534— SegmentedIndex.merge 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.
Serializer.value (cyclomatic 16) basex-core/src/main/java/org/basex/io/serial/Serializer.java:791— Serializer.value 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.
Client.redirect (cyclomatic 16) basex-core/src/main/java/org/basex/util/http/Client.java:279— Client.redirect has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
JaroWinkler.dst (cyclomatic 16) basex-core/src/main/java/org/basex/util/similarity/JaroWinkler.java:36— JaroWinkler.dst 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.
Table.finish (cyclomatic 16) basex-core/src/main/java/org/basex/util/Table.java:100— Table.finish has cyclomatic complexity 16 (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.
Util.message (cyclomatic 16) basex-core/src/main/java/org/basex/util/Util.java:168— Util.message 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.
XMLToken.encode (cyclomatic 16) basex-core/src/main/java/org/basex/util/XMLToken.java:287— XMLToken.encode has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SyntaxXQuery.scan (cognitive 166) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:915— SyntaxXQuery.scan has cognitive complexity 166 (threshold 15). Drivers by points: if/else 43 (121 pts), boolean chains 15, ternaries 4 (14 pts), match/switch 2 (9 pts), loops 2 (7 pts) (nesting depth added 100). 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.
QueryParser.dirElement (cognitive 150) basex-core/src/main/java/org/basex/query/QueryParser.java:3451— QueryParser.dirElement has cognitive complexity 150 (threshold 15). Drivers by points: if/else 32 (120 pts), loops 7 (13 pts), ternaries 3 (11 pts), boolean chains 6 (nesting depth added 102). 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.
MapRenderer.computeToolTip (cognitive 142) basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:449— MapRenderer.computeToolTip has cognitive complexity 142 (threshold 15). Drivers by points: if/else 21 (61 pts), ternaries 12 (44 pts), loops 8 (26 pts), boolean chains 11 (nesting depth added 90). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimpleMap.merge (cognitive 118) basex-core/src/main/java/org/basex/query/expr/SimpleMap.java:120— SimpleMap.merge has cognitive complexity 118 (threshold 15). Drivers by points: if/else 34 (71 pts), boolean chains 24, ternaries 3 (13 pts), error handling 2 (7 pts), loops 1 (3 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.
XMLParser.command (cognitive 108) basex-core/src/main/java/org/basex/core/parse/XMLParser.java:63— XMLParser.command has cognitive complexity 108 (threshold 15). Drivers by points: boolean chains 54, if/else 54. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
XMLScanner.markupDecl (cognitive 104) basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:808— XMLScanner.markupDecl has cognitive complexity 104 (threshold 15). Drivers by points: if/else 30 (70 pts), loops 5 (24 pts), boolean chains 6, ternaries 1 (4 pts) (nesting depth added 62). 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.
FnSubsequence.opt (cognitive 102) basex-core/src/main/java/org/basex/query/func/fn/FnSubsequence.java:276— FnSubsequence.opt has cognitive complexity 102 (threshold 15). Drivers by points: if/else 37 (89 pts), boolean chains 10, ternaries 1 (3 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.
Cmp.optBoolean (cognitive 99) basex-core/src/main/java/org/basex/query/expr/Cmp.java:246— Cmp.optBoolean has cognitive complexity 99 (threshold 15). Drivers by points: if/else 15 (60 pts), boolean chains 20, ternaries 4 (19 pts) (nesting depth added 60). 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.
XNode.deepEqual (cognitive 98) basex-core/src/main/java/org/basex/query/value/node/XNode.java:106— XNode.deepEqual has cognitive complexity 98 (threshold 15). Drivers by points: if/else 29 (60 pts), boolean chains 16, loops 7 (13 pts), ternaries 3 (9 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnReplace.value (cognitive 96) basex-core/src/main/java/org/basex/query/func/fn/FnReplace.java:37— FnReplace.value has cognitive complexity 96 (threshold 15). Drivers by points: if/else 19 (50 pts), loops 7 (26 pts), ternaries 6 (11 pts), boolean chains 9 (nesting depth added 55). 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.
FnLoadXQueryModule.value (cognitive 90) basex-core/src/main/java/org/basex/query/func/fn/FnLoadXQueryModule.java:42— FnLoadXQueryModule.value has cognitive complexity 90 (threshold 15). Drivers by points: if/else 25 (45 pts), loops 14 (24 pts), ternaries 4 (9 pts), boolean chains 6, error handling 3 (6 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Filter.optimize (cognitive 89) basex-core/src/main/java/org/basex/query/expr/Filter.java:104— Filter.optimize has cognitive complexity 89 (threshold 15). Drivers by points: if/else 35 (61 pts), boolean chains 16, ternaries 3 (8 pts), loops 2 (4 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DecFormatter.checkSyntax (cognitive 89) basex-core/src/main/java/org/basex/query/util/format/DecFormatter.java:293— DecFormatter.checkSyntax has cognitive complexity 89 (threshold 15). Drivers by points: if/else 25 (73 pts), boolean chains 8, ternaries 1 (5 pts), loops 2 (3 pts) (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegExLexer.normal (cognitive 86) basex-core/src/main/java/org/basex/query/util/regex/parse/RegExLexer.java:100— RegExLexer.normal has cognitive complexity 86 (threshold 15). Drivers by points: if/else 11 (43 pts), match/switch 6 (17 pts), ternaries 2 (12 pts), boolean chains 8, loops 1 (6 pts) (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.ftMatchOption (cognitive 86) basex-core/src/main/java/org/basex/query/QueryParser.java:4848— QueryParser.ftMatchOption has cognitive complexity 86 (threshold 15). Drivers by points: if/else 38 (76 pts), loops 2 (8 pts), boolean chains 2 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DecFormatter.format (cognitive 85) basex-core/src/main/java/org/basex/query/util/format/DecFormatter.java:527— DecFormatter.format has cognitive complexity 85 (threshold 15). Drivers by points: if/else 21 (39 pts), loops 11 (26 pts), ternaries 5 (14 pts), boolean chains 6 (nesting depth added 42). 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.
TextRenderer.write (cognitive 84) basex-core/src/main/java/org/basex/gui/text/TextRenderer.java:790— TextRenderer.write has cognitive complexity 84 (threshold 15). Drivers by points: if/else 26 (51 pts), boolean chains 15, loops 4 (10 pts), ternaries 5 (8 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapRenderer.drawSentence (cognitive 81) basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:255— MapRenderer.drawSentence has cognitive complexity 81 (threshold 15). Drivers by points: if/else 18 (59 pts), loops 5 (13 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JavaCall.toValue (cognitive 80) basex-core/src/main/java/org/basex/query/func/java/JavaCall.java:241— JavaCall.toValue has cognitive complexity 80 (threshold 15). Drivers by points: if/else 23 (54 pts), loops 7 (26 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.numericLiteral (cognitive 80) basex-core/src/main/java/org/basex/query/QueryParser.java:3130— QueryParser.numericLiteral has cognitive complexity 80 (threshold 15). Drivers by points: if/else 27 (52 pts), ternaries 6 (15 pts), boolean chains 12, loops 1 (nesting depth added 34). 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.
FTWords.indexAccessible (cognitive 78) basex-core/src/main/java/org/basex/query/expr/ft/FTWords.java:427— FTWords.indexAccessible has cognitive complexity 78 (threshold 15). Drivers by points: if/else 14 (45 pts), boolean chains 17, loops 3 (9 pts), ternaries 3 (7 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.
IndexRewrite.get (cognitive 78) basex-core/src/main/java/org/basex/query/util/index/IndexRewrite.java:55— IndexRewrite.get has cognitive complexity 78 (threshold 15). Drivers by points: if/else 20 (35 pts), ternaries 10 (24 pts), boolean chains 13, loops 4 (6 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Unit.test (cognitive 77) basex-core/src/main/java/org/basex/query/func/unit/Unit.java:74— Unit.test has cognitive complexity 77 (threshold 15). Drivers by points: if/else 18 (37 pts), loops 9 (19 pts), ternaries 4 (12 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnPath.value (cognitive 76) basex-core/src/main/java/org/basex/query/func/fn/FnPath.java:42— FnPath.value has cognitive complexity 76 (threshold 15). Drivers by points: if/else 24 (48 pts), ternaries 5 (13 pts), boolean chains 9, loops 3 (6 pts) (nesting depth added 35). 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.
QueryParser.annotations (cognitive 76) basex-core/src/main/java/org/basex/query/QueryParser.java:601— QueryParser.annotations has cognitive complexity 76 (threshold 15). Drivers by points: if/else 15 (47 pts), ternaries 3 (17 pts), loops 3 (9 pts), boolean chains 3 (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.
RestXqFunction.parseAnnotations (cognitive 75) basex-api/src/main/java/org/basex/http/restxq/RestXqFunction.java:113— RestXqFunction.parseAnnotations has cognitive complexity 75 (threshold 15). Drivers by points: if/else 26 (43 pts), ternaries 5 (15 pts), loops 6 (13 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pos.get (cognitive 75) basex-core/src/main/java/org/basex/query/expr/Pos.java:46— Pos.get has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 14 (36 pts), if/else 18 (33 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 38). 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.
Serializer.node (cognitive 72) basex-core/src/main/java/org/basex/io/serial/Serializer.java:549— Serializer.node has cognitive complexity 72 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 7 (18 pts), ternaries 4 (9 pts), boolean chains 7 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UCAOptions.get (cognitive 71) basex-core/src/main/java/org/basex/query/util/collation/UCAOptions.java:57— UCAOptions.get has cognitive complexity 71 (threshold 15). Drivers by points: if/else 34 (53 pts), ternaries 3 (9 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DecFormatter.analyze (cognitive 70) basex-core/src/main/java/org/basex/query/util/format/DecFormatter.java:394— DecFormatter.analyze has cognitive complexity 70 (threshold 15). Drivers by points: if/else 26 (53 pts), loops 4 (8 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonW3XmlSerializer.node (cognitive 69) basex-core/src/main/java/org/basex/io/serial/json/JsonW3XmlSerializer.java:43— JsonW3XmlSerializer.node has cognitive complexity 69 (threshold 15). Drivers by points: if/else 26 (55 pts), loops 3 (7 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shortcuts (cognitive 69) basex-modules/dba/src/main/resources/static/js.js:1256— shortcuts has cognitive complexity 69 (threshold 15). Drivers by points: if/else 27 (35 pts), boolean chains 19, ternaries 6 (13 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnItemsAt.opt (cognitive 68) basex-core/src/main/java/org/basex/query/func/fn/FnItemsAt.java:137— FnItemsAt.opt has cognitive complexity 68 (threshold 15). Drivers by points: if/else 25 (61 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 39). 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.
TextPanel.keyPressed (cognitive 66) basex-core/src/main/java/org/basex/gui/text/TextPanel.java:877— TextPanel.keyPressed has cognitive complexity 66 (threshold 15). Drivers by points: if/else 40 (43 pts), boolean chains 18, ternaries 3 (5 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
InfoView.setInfo (cognitive 66) basex-core/src/main/java/org/basex/gui/view/info/InfoView.java:162— InfoView.setInfo has cognitive complexity 66 (threshold 15). Drivers by points: if/else 22 (43 pts), loops 5 (13 pts), boolean chains 7, ternaries 3 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JapaneseTokenizer.moreWC (cognitive 66) basex-core/src/main/java/org/basex/util/ft/JapaneseTokenizer.java:199— JapaneseTokenizer.moreWC has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (52 pts), boolean chains 6, loops 2 (6 pts), ternaries 1 (2 pts) (nesting depth added 38). 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.
FormatterFR.word (cognitive 65) basex-core/src/main/java/org/basex/query/util/format/FormatterFR.java:93— FormatterFR.word has cognitive complexity 65 (threshold 15). Drivers by points: if/else 31 (44 pts), ternaries 4 (11 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NSNames.resolve (cognitive 65) basex-core/src/main/java/org/basex/data/NSNames.java:63— NSNames.resolve has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 9 (26 pts), if/else 8 (18 pts), loops 8 (12 pts), boolean chains 9 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableHeader.mouseDragged (cognitive 65) basex-core/src/main/java/org/basex/gui/view/table/TableHeader.java:203— TableHeader.mouseDragged has cognitive complexity 65 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 9 (24 pts), boolean chains 6 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableContent.paintComponent (cognitive 64) basex-core/src/main/java/org/basex/gui/view/table/TableContent.java:44— TableContent.paintComponent has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (39 pts), ternaries 3 (9 pts), boolean chains 8, loops 5 (8 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Range.optimizePos (cognitive 63) basex-core/src/main/java/org/basex/query/expr/Range.java:135— Range.optimizePos has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (41 pts), boolean chains 17, ternaries 3 (4 pts), match/switch 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlotView.paintComponent (cognitive 63) basex-core/src/main/java/org/basex/gui/view/plot/PlotView.java:270— PlotView.paintComponent has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (37 pts), ternaries 5 (16 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 31). 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.
Cmp.optCount (cognitive 62) basex-core/src/main/java/org/basex/query/expr/Cmp.java:327— Cmp.optCount has cognitive complexity 62 (threshold 15). Drivers by points: if/else 24 (45 pts), ternaries 2 (9 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FuncItem.fold (cognitive 62) basex-core/src/main/java/org/basex/query/value/item/FuncItem.java:374— FuncItem.fold has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 8 (20 pts), boolean chains 15, error handling 1 (3 pts), loops 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.
TextEditor.add (cognitive 62) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:1051— TextEditor.add has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (48 pts), ternaries 4 (8 pts), boolean chains 6 (nesting depth added 29). 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.
GUI.execute (cognitive 62) basex-core/src/main/java/org/basex/gui/GUI.java:353— GUI.execute has cognitive complexity 62 (threshold 15). Drivers by points: if/else 25 (46 pts), boolean chains 7, ternaries 3 (6 pts), error handling 2, loops 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.
FnFoldLeft.optType (cognitive 61) basex-core/src/main/java/org/basex/query/func/fn/FnFoldLeft.java:124— FnFoldLeft.optType has cognitive complexity 61 (threshold 15). Drivers by points: if/else 9 (27 pts), ternaries 9 (19 pts), loops 4 (11 pts), boolean chains 4 (nesting depth added 35). 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.
FnMin.opt (cognitive 61) basex-core/src/main/java/org/basex/query/func/fn/FnMin.java:103— FnMin.opt has cognitive complexity 61 (threshold 15). Drivers by points: if/else 14 (31 pts), ternaries 4 (17 pts), loops 2 (8 pts), boolean chains 5 (nesting depth added 36). 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.
ExploreArea.query (cognitive 60) basex-core/src/main/java/org/basex/gui/view/explore/ExploreArea.java:204— ExploreArea.query has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (33 pts), ternaries 6 (23 pts), boolean chains 3, loops 1 (nesting depth added 33). 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.
PlotView.drawAxis (cognitive 60) basex-core/src/main/java/org/basex/gui/view/plot/PlotView.java:446— PlotView.drawAxis has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (39 pts), ternaries 4 (9 pts), loops 3 (7 pts), boolean chains 5 (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.
1.next (cognitive 59) basex-core/src/main/java/org/basex/query/expr/ft/FTWords.java:167— 1.next has cognitive complexity 59 (threshold 15). Drivers by points: if/else 11 (35 pts), ternaries 4 (13 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 39). 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.
CmpG.optimize (cognitive 59) basex-core/src/main/java/org/basex/query/expr/CmpG.java:59— CmpG.optimize has cognitive complexity 59 (threshold 15). Drivers by points: if/else 27 (37 pts), boolean chains 18, ternaries 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Inspection.node (cognitive 59) basex-core/src/main/java/org/basex/data/Inspection.java:187— Inspection.node has cognitive complexity 59 (threshold 15). Drivers by points: if/else 26 (38 pts), boolean chains 12, ternaries 3 (8 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.
GFLWOR.optimizeCond (cognitive 58) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:747— GFLWOR.optimizeCond has cognitive complexity 58 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 5 (13 pts), boolean chains 12, ternaries 1 (5 pts) (nesting depth added 29). 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.
Formatter.number (cognitive 58) basex-core/src/main/java/org/basex/query/util/format/Formatter.java:668— Formatter.number has cognitive complexity 58 (threshold 15). Drivers by points: if/else 16 (39 pts), ternaries 2 (8 pts), boolean chains 6, loops 5 (nesting depth added 29). 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.
QueryParser.flwor (cognitive 58) basex-core/src/main/java/org/basex/query/QueryParser.java:1500— QueryParser.flwor has cognitive complexity 58 (threshold 15). Drivers by points: loops 10 (29 pts), if/else 11 (23 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 34). 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.
QueryJob.run (cognitive 58) basex-core/src/main/java/org/basex/core/jobs/QueryJob.java:245— QueryJob.run has cognitive complexity 58 (threshold 15). Drivers by points: if/else 30 (36 pts), ternaries 4 (8 pts), boolean chains 7, error handling 4 (5 pts), loops 1 (2 pts) (nesting depth added 12). 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.
Constr.add (cognitive 57) basex-core/src/main/java/org/basex/query/expr/constr/Constr.java:102— Constr.add has cognitive complexity 57 (threshold 15). Drivers by points: if/else 20 (40 pts), loops 3 (8 pts), boolean chains 6, ternaries 1 (3 pts) (nesting depth added 27). 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.
CmpG.optPred (cognitive 57) basex-core/src/main/java/org/basex/query/expr/CmpG.java:581— CmpG.optPred has cognitive complexity 57 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 5 (18 pts), ternaries 2 (7 pts), boolean chains 4 (nesting depth added 34). 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.
IntList.sort (cognitive 57) basex-core/src/main/java/org/basex/util/list/IntList.java:399— IntList.sort has cognitive complexity 57 (threshold 15). Drivers by points: if/else 11 (24 pts), ternaries 6 (23 pts), loops 5 (10 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GFLWOR.inlineForLet (cognitive 56) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:489— GFLWOR.inlineForLet has cognitive complexity 56 (threshold 15). Drivers by points: if/else 13 (41 pts), boolean chains 6, ternaries 1 (5 pts), loops 2 (4 pts) (nesting depth added 34). 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.
EnglishStemmer.s (cognitive 56) basex-core/src/main/java/org/basex/util/ft/EnglishStemmer.java:114— EnglishStemmer.s has cognitive complexity 56 (threshold 15). Drivers by points: if/else 23 (40 pts), boolean chains 12, loops 3 (4 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.
WesternTokenizer.more (cognitive 56) basex-core/src/main/java/org/basex/util/ft/WesternTokenizer.java:134— WesternTokenizer.more has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (38 pts), boolean chains 7, loops 3 (7 pts), ternaries 1 (4 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FTWildcard.parse (cognitive 55) basex-core/src/main/java/org/basex/query/expr/ft/FTWildcard.java:45— FTWildcard.parse has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (30 pts), ternaries 3 (13 pts), loops 3 (9 pts), boolean chains 3 (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.
ThesAccessor.source (cognitive 55) basex-core/src/main/java/org/basex/query/expr/ft/ThesAccessor.java:141— ThesAccessor.source has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 12 (40 pts), if/else 7 (9 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 31). 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.
Set.mergePaths (cognitive 55) basex-core/src/main/java/org/basex/query/expr/Set.java:169— Set.mergePaths has cognitive complexity 55 (threshold 15). Drivers by points: if/else 22 (38 pts), loops 6 (12 pts), boolean chains 5 (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.
TreeView.markSelectedNodes (cognitive 55) basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:439— TreeView.markSelectedNodes has cognitive complexity 55 (threshold 15). Drivers by points: if/else 8 (32 pts), loops 5 (20 pts), boolean chains 3 (nesting depth added 39). 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.
CElem.optimize (cognitive 54) basex-core/src/main/java/org/basex/query/expr/constr/CElem.java:73— CElem.optimize has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 5 (14 pts), boolean chains 8 (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.
Replace.value (cognitive 54) basex-core/src/main/java/org/basex/query/up/expr/Replace.java:44— Replace.value has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (40 pts), ternaries 3 (12 pts), boolean chains 1, loops 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BigArray.subArr (cognitive 54) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:250— BigArray.subArr has cognitive complexity 54 (threshold 15). Drivers by points: if/else 24 (35 pts), ternaries 9 (18 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XQArray.toJava (cognitive 54) basex-core/src/main/java/org/basex/query/value/array/XQArray.java:403— XQArray.toJava has cognitive complexity 54 (threshold 15). Drivers by points: loops 11 (30 pts), if/else 11 (20 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 30). 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.
BigSeq.subSeq (cognitive 54) basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:242— BigSeq.subSeq has cognitive complexity 54 (threshold 15). Drivers by points: if/else 24 (35 pts), ternaries 9 (18 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeqType.coerce (cognitive 53) basex-core/src/main/java/org/basex/query/value/type/SeqType.java:413— SeqType.coerce has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (39 pts), loops 3 (6 pts), error handling 2 (5 pts), boolean chains 2, ternaries 1 (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.
RestXqResponse.build (cognitive 52) basex-api/src/main/java/org/basex/http/restxq/RestXqResponse.java:181— RestXqResponse.build has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (39 pts), ternaries 1 (7 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FormatterDE.word (cognitive 52) basex-core/src/main/java/org/basex/query/util/format/FormatterDE.java:122— FormatterDE.word has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (28 pts), ternaries 6 (18 pts), boolean chains 4, loops 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.
DataFTBuilder.build (cognitive 52) basex-core/src/main/java/org/basex/query/util/DataFTBuilder.java:79— DataFTBuilder.build has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (33 pts), loops 5 (8 pts), boolean chains 7, ternaries 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShapeType.intersect (cognitive 52) basex-core/src/main/java/org/basex/query/value/type/ShapeType.java:463— ShapeType.intersect has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (27 pts), ternaries 7 (19 pts), loops 2 (4 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.
UserInfo.digest (cognitive 52) basex-core/src/main/java/org/basex/util/http/UserInfo.java:120— UserInfo.digest has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (34 pts), ternaries 3 (9 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Arr.optimizeEbv (cognitive 51) basex-core/src/main/java/org/basex/query/expr/Arr.java:189— Arr.optimizeEbv has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 11, ternaries 4 (9 pts), loops 4 (6 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.itemType (cognitive 51) basex-core/src/main/java/org/basex/query/QueryParser.java:4256— QueryParser.itemType has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (37 pts), ternaries 3 (8 pts), loops 1 (4 pts), boolean chains 2 (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.
RestXqFunction.error (cognitive 50) basex-api/src/main/java/org/basex/http/restxq/RestXqFunction.java:511— RestXqFunction.error has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (39 pts), ternaries 3 (7 pts), boolean chains 3, loops 1 (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.
CmpR.merge (cognitive 50) basex-core/src/main/java/org/basex/query/expr/CmpR.java:261— CmpR.merge has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 6 (15 pts), boolean chains 12 (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.
DialogManage.action (cognitive 50) basex-core/src/main/java/org/basex/gui/dialog/DialogManage.java:137— DialogManage.action has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (32 pts), loops 4 (8 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (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.
CsvSerializer.field (cognitive 50) basex-core/src/main/java/org/basex/io/serial/csv/CsvSerializer.java:147— CsvSerializer.field has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 13, ternaries 2 (6 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonNodeSerializer.finishOpen (cognitive 50) basex-core/src/main/java/org/basex/io/serial/json/JsonNodeSerializer.java:168— JsonNodeSerializer.finishOpen has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (42 pts), loops 1 (3 pts), ternaries 1 (3 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.
Options.assign (cognitive 50) basex-core/src/main/java/org/basex/util/options/Options.java:907— Options.assign has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 2 (6 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 25). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
XQueryEval.eval (cognitive 49) basex-core/src/main/java/org/basex/query/func/xquery/XQueryEval.java:59— XQueryEval.eval has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 10 (18 pts), loops 3 (5 pts), boolean chains 3, error handling 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Arith.optimize (cognitive 49) basex-core/src/main/java/org/basex/query/expr/Arith.java:42— Arith.optimize has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 14, ternaries 4 (14 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexInfo.create (cognitive 49) basex-core/src/main/java/org/basex/query/util/index/IndexInfo.java:207— IndexInfo.create has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 3 (11 pts), boolean chains 8, ternaries 2 (3 pts) (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.
Formatter.format (cognitive 49) basex-core/src/main/java/org/basex/gui/text/Formatter.java:118— Formatter.format has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 17, ternaries 1 (3 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.
Stats.add (cognitive 49) basex-core/src/main/java/org/basex/index/stats/Stats.java:108— Stats.add has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (40 pts), ternaries 3 (6 pts), boolean chains 3 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ColognePhonetic.encode (cognitive 49) basex-core/src/main/java/org/basex/util/similarity/ColognePhonetic.java:45— ColognePhonetic.encode has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 13, ternaries 3 (10 pts), loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnParseUri.value (cognitive 47) basex-core/src/main/java/org/basex/query/func/fn/FnParseUri.java:57— FnParseUri.value has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (28 pts), ternaries 5 (9 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 10). 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.
FnSum.opt (cognitive 47) basex-core/src/main/java/org/basex/query/func/fn/FnSum.java:75— FnSum.opt has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (28 pts), ternaries 3 (8 pts), loops 2 (7 pts), boolean chains 4 (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.
JavaCall.get (cognitive 47) basex-core/src/main/java/org/basex/query/func/java/JavaCall.java:330— JavaCall.get has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (30 pts), error handling 2 (6 pts), ternaries 2 (5 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 27). 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.
CmpG.optArith (cognitive 47) basex-core/src/main/java/org/basex/query/expr/CmpG.java:223— CmpG.optArith has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 5 (18 pts), if/else 6 (15 pts), boolean chains 14 (nesting depth added 22). 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.
SeqType.cast (cognitive 47) basex-core/src/main/java/org/basex/query/value/type/SeqType.java:206— SeqType.cast has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (39 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryError.typeError (cognitive 47) basex-core/src/main/java/org/basex/query/QueryError.java:1835— QueryError.typeError has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 2 (7 pts), ternaries 2 (7 pts), boolean chains 4 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
QueryParser.castTarget (cognitive 47) basex-core/src/main/java/org/basex/query/QueryParser.java:4150— QueryParser.castTarget has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (34 pts), ternaries 4 (12 pts), boolean chains 1 (nesting depth added 28). 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.
MapRenderer.drawText (cognitive 47) basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:77— MapRenderer.drawText has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (35 pts), loops 3 (7 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TreeView.keyPressed (cognitive 47) basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:1024— TreeView.keyPressed has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 3 (8 pts), boolean chains 4, ternaries 1 (4 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnMin.minmax (cognitive 46) basex-core/src/main/java/org/basex/query/func/fn/FnMin.java:44— FnMin.minmax has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 6 (23 pts), if/else 10 (19 pts), boolean chains 3, loops 1 (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.
AQuery.run (cognitive 46) basex-core/src/main/java/org/basex/core/cmd/AQuery.java:61— AQuery.run has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (25 pts), ternaries 4 (8 pts), error handling 3 (6 pts), loops 2 (6 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.
Optimize.optimize (cognitive 45) basex-core/src/main/java/org/basex/core/cmd/Optimize.java:102— Optimize.optimize has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EditorView.run (cognitive 45) basex-core/src/main/java/org/basex/gui/view/editor/EditorView.java:607— EditorView.run has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 10, error handling 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonParser.string (cognitive 45) basex-core/src/main/java/org/basex/io/parse/json/JsonParser.java:345— JsonParser.string has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 6, loops 2 (5 pts), match/switch 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapToElement.members (cognitive 44) basex-core/src/main/java/org/basex/query/func/fn/MapToElement.java:246— MapToElement.members has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (42 pts), boolean chains 1, loops 1 (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.
Step.nodes (cognitive 44) basex-core/src/main/java/org/basex/query/expr/path/Step.java:332— Step.nodes has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 4 (10 pts), ternaries 3 (7 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Replace.lazyReplace (cognitive 44) basex-core/src/main/java/org/basex/query/up/atomic/Replace.java:75— Replace.lazyReplace has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 7, match/switch 1 (3 pts), loops 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntFormat.<init> (cognitive 44) basex-core/src/main/java/org/basex/query/util/format/IntFormat.java:25— IntFormat.<init> has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (32 pts), boolean chains 6, loops 2 (5 pts), ternaries 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.
IndexInfo.type (cognitive 44) basex-core/src/main/java/org/basex/query/util/index/IndexInfo.java:86— IndexInfo.type has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 11, ternaries 3 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.functionTest (cognitive 44) basex-core/src/main/java/org/basex/query/QueryParser.java:4351— QueryParser.functionTest has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 4 (11 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CMap.optimize (cognitive 43) basex-core/src/main/java/org/basex/query/expr/constr/CMap.java:40— CMap.optimize has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 5 (7 pts), ternaries 3 (5 pts), boolean chains 4 (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.
FingerTreeIterator.init (cognitive 43) basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:100— FingerTreeIterator.init has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 5 (13 pts), ternaries 1 (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.
QueryParser.entity (cognitive 43) basex-core/src/main/java/org/basex/query/QueryParser.java:5245— QueryParser.entity has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 6, loops 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DialogProps.action (cognitive 43) basex-core/src/main/java/org/basex/gui/dialog/DialogProps.java:275— DialogProps.action has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (26 pts), ternaries 3 (10 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 22). 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.
Formatter.whitespace (cognitive 43) basex-core/src/main/java/org/basex/gui/text/Formatter.java:334— Formatter.whitespace has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (22 pts), ternaries 5 (13 pts), boolean chains 8 (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.
TypedKeys.comparator (cognitive 42) basex-core/src/main/java/org/basex/query/util/TypedKeys.java:31— TypedKeys.comparator has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 8 (14 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.axisStep (cognitive 42) basex-core/src/main/java/org/basex/query/QueryParser.java:2671— QueryParser.axisStep has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 2 (4 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CsvParser.parse (cognitive 42) basex-core/src/main/java/org/basex/io/parse/csv/CsvParser.java:76— CsvParser.parse has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
QueryParser.arrow (cognitive 41) basex-core/src/main/java/org/basex/query/QueryParser.java:2363— QueryParser.arrow has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 24). 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.
SearchContext.normalize (cognitive 41) basex-core/src/main/java/org/basex/gui/text/SearchContext.java:99— SearchContext.normalize has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (26 pts), ternaries 2 (6 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RestXqResponse.serialize (cognitive 40) basex-api/src/main/java/org/basex/http/restxq/RestXqResponse.java:74— RestXqResponse.serialize has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 6 (10 pts), loops 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynFuncCall.optimize (cognitive 40) basex-core/src/main/java/org/basex/query/func/DynFuncCall.java:81— DynFuncCall.optimize has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 6, loops 2 (6 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Path.cleanSteps (cognitive 40) basex-core/src/main/java/org/basex/query/expr/path/Path.java:421— Path.cleanSteps has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 11, ternaries 2 (3 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.
ANum.compare (cognitive 40) basex-core/src/main/java/org/basex/query/value/item/ANum.java:196— ANum.compare has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 5 (21 pts), if/else 11 (17 pts), boolean chains 2 (nesting depth added 22). 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.
DOMWrapper.parse (cognitive 40) basex-core/src/main/java/org/basex/build/xml/DOMWrapper.java:41— DOMWrapper.parse has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 2 (5 pts), ternaries 1 (4 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Formatter.lengths (cognitive 40) basex-core/src/main/java/org/basex/gui/text/Formatter.java:226— Formatter.lengths has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 10, loops 3 (7 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.
SyntaxXQuery.code (cognitive 40) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:348— SyntaxXQuery.code has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 7 (14 pts), boolean chains 10 (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.
TextEditor.enclosing (cognitive 40) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:2101— TextEditor.enclosing has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 6 (12 pts), boolean chains 10, ternaries 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.
SegmentedValues.iter (cognitive 40) basex-core/src/main/java/org/basex/index/value/SegmentedValues.java:176— SegmentedValues.iter has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (12 pts), ternaries 2 (9 pts), boolean chains 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Switch.opt (cognitive 39) basex-core/src/main/java/org/basex/query/expr/Switch.java:118— Switch.opt has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 4, loops 3 (4 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.
GroupScanner.groupInfo (cognitive 39) basex-core/src/main/java/org/basex/query/util/regex/RegExpr.java:207— GroupScanner.groupInfo has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (32 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeepEqual.equal (cognitive 39) basex-core/src/main/java/org/basex/query/util/DeepEqual.java:114— DeepEqual.equal has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 4 (7 pts), boolean chains 4, ternaries 1 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XMLParser.parseElement (cognitive 39) basex-core/src/main/java/org/basex/build/xml/XMLParser.java:121— XMLParser.parseElement has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 2, loops 1, ternaries 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.
Options.toString (cognitive 39) basex-core/src/main/java/org/basex/util/options/Options.java:850— Options.toString has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 5 (17 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.
activity.showActivity (cognitive 39) basex-modules/dba/src/main/resources/static/activity.js:88— activity.showActivity has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 4 (10 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnUpdate.change (cognitive 38) basex-core/src/main/java/org/basex/query/func/fn/FnUpdate.java:272— FnUpdate.change has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 6 (10 pts), loops 2 (5 pts), boolean chains 3, match/switch 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.
JavaCall.convert (cognitive 38) basex-core/src/main/java/org/basex/query/func/java/JavaCall.java:147— JavaCall.convert has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 17, ternaries 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Unfold.count (cognitive 38) basex-core/src/main/java/org/basex/query/expr/Unfold.java:233— Unfold.count has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 10 (16 pts), boolean chains 4, 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.
DeepTree.insert (cognitive 38) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:292— DeepTree.insert has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (29 pts), ternaries 4 (6 pts), loops 2 (3 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.
QueryParser.ftSelection (cognitive 38) basex-core/src/main/java/org/basex/query/QueryParser.java:4599— QueryParser.ftSelection has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (27 pts), ternaries 2 (7 pts), boolean chains 3, 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.
QueryParser.prolog1 (cognitive 38) basex-core/src/main/java/org/basex/query/QueryParser.java:487— QueryParser.prolog1 has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (31 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonW3XmlSerializer.unescape (cognitive 38) basex-core/src/main/java/org/basex/io/serial/json/JsonW3XmlSerializer.java:305— JsonW3XmlSerializer.unescape has cognitive complexity 38 (threshold 15). Drivers by points: if/else 5 (16 pts), ternaries 2 (11 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GreekStemmer.rule0 (cognitive 38) basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:81— GreekStemmer.rule0 has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 23, if/else 15. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
FnSlice.opt (cognitive 37) basex-core/src/main/java/org/basex/query/func/fn/FnSlice.java:38— FnSlice.opt has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 8, ternaries 1 (4 pts) (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.
3.next (cognitive 37) basex-core/src/main/java/org/basex/query/expr/gflwor/Window.java:194— 3.next has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 3 (6 pts), boolean chains 3 (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.
Preds.flattenEbv (cognitive 37) basex-core/src/main/java/org/basex/query/expr/Preds.java:273— Preds.flattenEbv has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 5 (9 pts), boolean chains 7 (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.
QueryParser.simpleNodeTest (cognitive 37) basex-core/src/main/java/org/basex/query/QueryParser.java:2763— QueryParser.simpleNodeTest has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (24 pts), ternaries 3 (9 pts), boolean chains 4 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SyntaxJS.mode (cognitive 37) basex-core/src/main/java/org/basex/gui/text/SyntaxJS.java:63— SyntaxJS.mode has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (23 pts), ternaries 4 (8 pts), boolean chains 6 (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.
Payload.multiForm (cognitive 37) basex-core/src/main/java/org/basex/util/http/Payload.java:339— Payload.multiForm has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (25 pts), ternaries 2 (10 pts), boolean chains 1, loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
GFLWOR.posToPred (cognitive 36) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:830— GFLWOR.posToPred has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 9, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Path.iterative (cognitive 36) basex-core/src/main/java/org/basex/query/expr/path/Path.java:520— Path.iterative has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 5, loops 2 (4 pts), ternaries 1 (3 pts), match/switch 1 (2 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.
Formatter.formatZone (cognitive 36) basex-core/src/main/java/org/basex/query/util/format/Formatter.java:493— Formatter.formatZone has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 4 (8 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PkgValidator.availVersion (cognitive 36) basex-core/src/main/java/org/basex/query/util/pkg/PkgValidator.java:109— PkgValidator.availVersion has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 5 (10 pts), boolean chains 4 (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.
XNode.compare (cognitive 36) basex-core/src/main/java/org/basex/query/value/node/XNode.java:468— XNode.compare has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (18 pts), ternaries 4 (11 pts), loops 4 (7 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.
QueryParser.stringConstructor (cognitive 36) basex-core/src/main/java/org/basex/query/QueryParser.java:3398— QueryParser.stringConstructor has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 3 (9 pts), boolean chains 6, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyntaxMD.mode (cognitive 36) basex-core/src/main/java/org/basex/gui/text/SyntaxMD.java:82— SyntaxMD.mode has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 10, loops 1 (2 pts), ternaries 1 (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.
TreeView.focus (cognitive 36) basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:807— TreeView.focus has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (7 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntList.sort (cognitive 36) basex-core/src/main/java/org/basex/util/list/IntList.java:281— IntList.sort has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 7 (14 pts), ternaries 1 (5 pts), boolean chains 3 (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.
XMLToken.encode (cognitive 36) basex-core/src/main/java/org/basex/util/XMLToken.java:287— XMLToken.encode has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 4 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RESTRetrieve.run0 (cognitive 35) basex-api/src/main/java/org/basex/http/rest/RESTRetrieve.java:37— RESTRetrieve.run0 has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 4 (14 pts), if/else 7 (11 pts), loops 3 (7 pts), boolean chains 3 (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.
DeepTree.slice (cognitive 35) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:618— DeepTree.slice has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (18 pts), ternaries 6 (9 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 9). 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.
FormatParser.presentation (cognitive 35) basex-core/src/main/java/org/basex/query/util/format/FormatParser.java:64— FormatParser.presentation has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 8, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.component (cognitive 35) basex-core/src/main/java/org/basex/query/util/format/Formatter.java:207— Formatter.component has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 7 (14 pts), boolean chains 3, loops 1 (2 pts), match/switch 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.
RepoManager.delete (cognitive 35) basex-core/src/main/java/org/basex/query/util/pkg/RepoManager.java:130— RepoManager.delete has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (30 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransferVisitor.value (cognitive 35) basex-core/src/main/java/org/basex/query/util/TransferVisitor.java:92— TransferVisitor.value has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (26 pts), error handling 2 (4 pts), loops 2 (4 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.
QueryJob.<init> (cognitive 35) basex-core/src/main/java/org/basex/core/jobs/QueryJob.java:62— QueryJob.<init> has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 3, ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyntaxXQuery.indent (cognitive 35) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:1118— SyntaxXQuery.indent has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 10 (12 pts), boolean chains 8 (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.
TreeView.paintComponent (cognitive 35) basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:142— TreeView.paintComponent has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 7, 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.
SegmentedIndex.merge (cognitive 35) basex-core/src/main/java/org/basex/index/SegmentedIndex.java:534— SegmentedIndex.merge has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (8 pts), ternaries 2 (6 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Serializer.node (cognitive 35) basex-core/src/main/java/org/basex/io/serial/Serializer.java:663— Serializer.node has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 4 (9 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XMLToken.decode (cognitive 35) basex-core/src/main/java/org/basex/util/XMLToken.java:345— XMLToken.decode has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 5, ternaries 1 (4 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GmlDialect.of (cognitive 35) basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoFn.java:336— GmlDialect.of has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (34 pts), loops 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.
DigitalSignature.generate (cognitive 34) REDACTED:103— DigitalSignature.generate has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (21 pts), error handling 7 (8 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 7). 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.
JavaCall.type (cognitive 34) basex-core/src/main/java/org/basex/query/func/java/JavaCall.java:651— JavaCall.type has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (26 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Path.mergeStep (cognitive 34) basex-core/src/main/java/org/basex/query/expr/path/Path.java:971— Path.mergeStep has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 8, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnicodeNoCaseCollation.indexOf (cognitive 34) basex-core/src/main/java/org/basex/query/util/collation/UnicodeNoCaseCollation.java:21— UnicodeNoCaseCollation.indexOf has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (18 pts), ternaries 4 (11 pts), loops 2 (5 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.
QueryContext.cast (cognitive 34) basex-core/src/main/java/org/basex/query/QueryContext.java:919— QueryContext.cast has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (11 pts), loops 3 (7 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Locking.acquire (cognitive 34) basex-core/src/main/java/org/basex/core/locks/Locking.java:97— Locking.acquire has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 4 (7 pts), boolean chains 6, ternaries 1 (3 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Inspection.<init> (cognitive 34) basex-core/src/main/java/org/basex/data/Inspection.java:131— Inspection.<init> has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (25 pts), loops 2 (3 pts), ternaries 3, error handling 1 (2 pts), boolean chains 1 (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.
ExploreArea.actionPerformed (cognitive 34) basex-core/src/main/java/org/basex/gui/view/explore/ExploreArea.java:151— ExploreArea.actionPerformed has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 2 (8 pts), loops 2 (5 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
1.next (cognitive 34) basex-core/src/main/java/org/basex/index/value/SegmentedValues.java:266— 1.next has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 4 (13 pts), if/else 4 (10 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentedIndex.index (cognitive 34) basex-core/src/main/java/org/basex/index/SegmentedIndex.java:185— SegmentedIndex.index has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 3 (9 pts) (nesting depth added 22). 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.
SerializerOptions.toString (cognitive 34) basex-core/src/main/java/org/basex/io/serial/SerializerOptions.java:364— SerializerOptions.toString has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 2 (4 pts), boolean chains 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.
FnBuildUri.value (cognitive 33) basex-core/src/main/java/org/basex/query/func/fn/FnBuildUri.java:19— FnBuildUri.value has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 4 (8 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SaxonTransform.executable (cognitive 33) basex-core/src/main/java/org/basex/query/func/fn/SaxonTransform.java:247— SaxonTransform.executable has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 7 (10 pts), loops 1 (3 pts), boolean chains 2, error handling 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.
GFLWOR.rewrite (cognitive 33) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:248— GFLWOR.rewrite has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 7, ternaries 3 (6 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HtmlNoCaseCollation.indexOf (cognitive 33) basex-core/src/main/java/org/basex/query/util/collation/HtmlNoCaseCollation.java:27— HtmlNoCaseCollation.indexOf has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (18 pts), ternaries 3 (10 pts), loops 2 (5 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.
DecFormatter.<init> (cognitive 33) basex-core/src/main/java/org/basex/query/util/format/DecFormatter.java:87— DecFormatter.<init> has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (28 pts), loops 4, 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.
QueryParser.comparison (cognitive 33) basex-core/src/main/java/org/basex/query/QueryParser.java:2069— QueryParser.comparison has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.prolog2 (cognitive 33) basex-core/src/main/java/org/basex/query/QueryParser.java:543— QueryParser.prolog2 has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextPanel.mousePressed (cognitive 33) basex-core/src/main/java/org/basex/gui/text/TextPanel.java:738— TextPanel.mousePressed has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 6 (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.
JsonXmlConverter.finish (cognitive 33) basex-core/src/main/java/org/basex/io/parse/json/JsonXmlConverter.java:66— JsonXmlConverter.finish has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (12 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupSerializer.text (cognitive 33) basex-core/src/main/java/org/basex/io/serial/MarkupSerializer.java:235— MarkupSerializer.text has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 16). 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.
FnEmpty.opt (cognitive 32) basex-core/src/main/java/org/basex/query/func/fn/FnEmpty.java:43— FnEmpty.opt has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 6 (12 pts), boolean chains 5 (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.
JobListDetails.value (cognitive 32) basex-core/src/main/java/org/basex/query/func/job/JobListDetails.java:24— JobListDetails.value has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartFunc.optimize (cognitive 32) basex-core/src/main/java/org/basex/query/func/PartFunc.java:58— PartFunc.optimize has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (6 pts), ternaries 1 (5 pts), boolean chains 4 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FTContent.filter (cognitive 32) basex-core/src/main/java/org/basex/query/expr/ft/FTContent.java:36— FTContent.filter has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (12 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Insert.value (cognitive 32) basex-core/src/main/java/org/basex/query/up/expr/Insert.java:52— Insert.value has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 3 (10 pts), boolean chains 1, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegExLexer.escape (cognitive 32) basex-core/src/main/java/org/basex/query/util/regex/parse/RegExLexer.java:187— RegExLexer.escape has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 8, loops 2 (4 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TextEditor.sort (cognitive 32) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:882— TextEditor.sort has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 4 (7 pts), ternaries 2, 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.
TextEditor.splitLines (cognitive 32) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:2003— TextEditor.splitLines has cognitive complexity 32 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 5 (11 pts), boolean chains 6 (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.
ProjectFiles.filter (cognitive 32) basex-core/src/main/java/org/basex/gui/view/project/ProjectFiles.java:235— ProjectFiles.filter has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (21 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndonesianStemmer.remFirstPrefix (cognitive 32) basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:200— IndonesianStemmer.remFirstPrefix has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 15 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Options.read (cognitive 32) basex-core/src/main/java/org/basex/util/options/Options.java:1026— Options.read has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3 (11 pts), error handling 2 (6 pts), loops 1 (2 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.
Table.finish (cognitive 32) basex-core/src/main/java/org/basex/util/Table.java:100— Table.finish has cognitive complexity 32 (threshold 15). Drivers by points: loops 11 (23 pts), if/else 3 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 16). 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.
RestXqFunction.bind (cognitive 31) basex-api/src/main/java/org/basex/http/restxq/RestXqFunction.java:216— RestXqFunction.bind has cognitive complexity 31 (threshold 15). Drivers by points: loops 9 (15 pts), if/else 5 (9 pts), ternaries 2 (4 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
WebPathMatcher.parse (cognitive 31) basex-api/src/main/java/org/basex/http/web/WebPathMatcher.java:87— WebPathMatcher.parse has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (25 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.
FnSchemaType.annotate (cognitive 31) basex-core/src/main/java/org/basex/query/func/fn/FnSchemaType.java:41— FnSchemaType.annotate has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 7 (16 pts), if/else 4 (7 pts), loops 2 (5 pts), match/switch 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlainDoc.function (cognitive 31) basex-core/src/main/java/org/basex/query/func/inspect/PlainDoc.java:98— PlainDoc.function has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (8 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Arr.rewrite (cognitive 31) basex-core/src/main/java/org/basex/query/expr/Arr.java:287— Arr.rewrite has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 4 (7 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
List.toRange (cognitive 31) basex-core/src/main/java/org/basex/query/expr/List.java:117— List.toRange has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Preds.optimize (cognitive 31) basex-core/src/main/java/org/basex/query/expr/Preds.java:110— Preds.optimize has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 9, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GNodeBuilder.sort (cognitive 31) basex-core/src/main/java/org/basex/query/util/list/GNodeBuilder.java:180— GNodeBuilder.sort has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 5 (10 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XQArray.toString (cognitive 31) basex-core/src/main/java/org/basex/query/value/array/XQArray.java:483— XQArray.toString has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 2 (7 pts), loops 2 (5 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.argumentList (cognitive 31) basex-core/src/main/java/org/basex/query/QueryParser.java:3361— QueryParser.argumentList has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.forClause (cognitive 31) basex-core/src/main/java/org/basex/query/QueryParser.java:1624— QueryParser.forClause has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 7 (11 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.labeledRecordTypeDecl (cognitive 31) basex-core/src/main/java/org/basex/query/QueryParser.java:1169— QueryParser.labeledRecordTypeDecl has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 3 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapView.paintComponent (cognitive 31) basex-core/src/main/java/org/basex/gui/view/map/MapView.java:272— MapView.paintComponent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 7, loops 1 (2 pts), ternaries 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.
RestXqWadl.create (cognitive 30) basex-api/src/main/java/org/basex/http/restxq/RestXqWadl.java:57— RestXqWadl.create has cognitive complexity 30 (threshold 15). Drivers by points: loops 8 (20 pts), if/else 2 (6 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
DbNew.fillXmlInput (cognitive 30) basex-core/src/main/java/org/basex/query/func/db/DbNew.java:93— DbNew.fillXmlInput has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 2 (6 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnFoldLeft.flatten (cognitive 30) basex-core/src/main/java/org/basex/query/func/fn/FnFoldLeft.java:187— FnFoldLeft.flatten has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12, boolean chains 10, ternaries 5 (7 pts), loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PlanFn.plan (cognitive 30) basex-core/src/main/java/org/basex/query/func/fn/PlanFn.java:231— PlanFn.plan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StaticFunc.compile (cognitive 30) basex-core/src/main/java/org/basex/query/func/StaticFunc.java:204— StaticFunc.compile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (6 pts), boolean chains 3, error handling 1 (2 pts), ternaries 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.
ThesAccessor.find (cognitive 30) basex-core/src/main/java/org/basex/query/expr/ft/ThesAccessor.java:194— ThesAccessor.find has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 5 (8 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XMLScanner.<init> (cognitive 30) basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:101— XMLScanner.<init> has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), ternaries 1 (4 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 16). 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.
User.<init> (cognitive 30) basex-core/src/main/java/org/basex/core/users/User.java:87— User.<init> has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (7 pts), ternaries 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.
Writer.write (cognitive 30) basex-core/src/main/java/org/basex/data/NSEntries.java:583— Writer.write has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 4 (7 pts), ternaries 2 (6 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.
BaseXFileChooser.selectAll (cognitive 30) basex-core/src/main/java/org/basex/gui/layout/BaseXFileChooser.java:114— BaseXFileChooser.selectAll has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (6 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyntaxMarkup.mode (cognitive 30) basex-core/src/main/java/org/basex/gui/text/SyntaxMarkup.java:141— SyntaxMarkup.mode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 7, ternaries 4 (6 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.
TextEditor.comment (cognitive 30) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:529— TextEditor.comment has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 4 (9 pts), boolean chains 8, if/else 7, loops 4 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SquarifiedAlgo.calcMap (cognitive 30) basex-core/src/main/java/org/basex/gui/view/map/SquarifiedAlgo.java:11— SquarifiedAlgo.calcMap has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 5 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnCollection.collection (cognitive 29) basex-core/src/main/java/org/basex/query/func/fn/FnCollection.java:63— FnCollection.collection has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (7 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlanType.get (cognitive 29) basex-core/src/main/java/org/basex/query/func/fn/PlanFn.java:110— PlanType.get has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 4 (9 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UtilCountWithin.opt (cognitive 29) basex-core/src/main/java/org/basex/query/func/util/UtilCountWithin.java:70— UtilCountWithin.opt has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 5, ternaries 1 (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.
FTContains.value (cognitive 29) basex-core/src/main/java/org/basex/query/expr/ft/FTContains.java:47— FTContains.value has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 2 (3 pts), ternaries 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.
1.next (cognitive 29) basex-core/src/main/java/org/basex/query/expr/gflwor/For.java:67— 1.next has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 1, 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.
GFLWOR.unusedVars (cognitive 29) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:402— GFLWOR.unusedVars has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 6, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Path.children (cognitive 29) basex-core/src/main/java/org/basex/query/expr/path/Path.java:745— Path.children has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (7 pts), boolean chains 5, ternaries 2 (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.
If.opt (cognitive 29) basex-core/src/main/java/org/basex/query/expr/If.java:121— If.opt has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 4 (9 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DateFormat.<init> (cognitive 29) basex-core/src/main/java/org/basex/query/util/format/DateFormat.java:29— DateFormat.<init> has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 3, ternaries 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.
FormatterEN.word (cognitive 29) basex-core/src/main/java/org/basex/query/util/format/FormatterEN.java:115— FormatterEN.word has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 3 (8 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Collector.collect (cognitive 29) basex-core/src/main/java/org/basex/query/value/type/RecordType.java:264— Collector.collect has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (12 pts), match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
XMLScanner.ref (cognitive 29) basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:495— XMLScanner.ref has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 6, ternaries 2 (4 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.
Data.update (cognitive 29) basex-core/src/main/java/org/basex/data/Data.java:725— Data.update has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 6 (11 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyntaxMD.inline (cognitive 29) basex-core/src/main/java/org/basex/gui/text/SyntaxMD.java:336— SyntaxMD.inline has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 8, ternaries 2 (7 pts), loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FolderView.keyPressed (cognitive 29) basex-core/src/main/java/org/basex/gui/view/folder/FolderView.java:395— FolderView.keyPressed has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 7, loops 2 (4 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MapPainter.drawRectangles (cognitive 29) basex-core/src/main/java/org/basex/gui/view/map/MapPainter.java:70— MapPainter.drawRectangles has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 4 (10 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FTFuzzy.offsets (cognitive 29) basex-core/src/main/java/org/basex/index/ft/FTFuzzy.java:95— FTFuzzy.offsets has cognitive complexity 29 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 5 (11 pts), boolean chains 6 (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.
JsonSerializer.function (cognitive 29) basex-core/src/main/java/org/basex/io/serial/json/JsonSerializer.java:105— JsonSerializer.function has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), ternaries 2 (5 pts), loops 2 (4 pts), error handling 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.
SerializerOptions.characterMap (cognitive 29) basex-core/src/main/java/org/basex/io/serial/SerializerOptions.java:321— SerializerOptions.characterMap has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseX.parseArgs (cognitive 29) REDACTED:191— BaseX.parseArgs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 2 (7 pts), boolean chains 4, match/switch 1 (4 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseX.<init> (cognitive 29) REDACTED:54— BaseX.<init> has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 2 (6 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnHead.opt (cognitive 28) basex-core/src/main/java/org/basex/query/func/fn/FnHead.java:30— FnHead.opt has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 6, ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
FnLowest.opt (cognitive 28) basex-core/src/main/java/org/basex/query/func/fn/FnLowest.java:74— FnLowest.opt has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 7, ternaries 3 (7 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.
FnTransform.outputProperties (cognitive 28) basex-core/src/main/java/org/basex/query/func/fn/FnTransform.java:283— FnTransform.outputProperties has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (5 pts), ternaries 1 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SelectorStep.matches (cognitive 28) basex-core/src/main/java/org/basex/query/expr/path/SelectorStep.java:98— SelectorStep.matches has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (6 pts), ternaries 1 (5 pts), boolean chains 2 (nesting depth added 16). 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.
List.value (cognitive 28) basex-core/src/main/java/org/basex/query/expr/List.java:213— List.value has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 4 (10 pts), ternaries 1 (5 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataBuilder.stripNamespaces (cognitive 28) basex-core/src/main/java/org/basex/query/util/DataBuilder.java:384— DataBuilder.stripNamespaces has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 3, loops 2 (nesting depth added 14). 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.
XQMap.deepEqual (cognitive 28) basex-core/src/main/java/org/basex/query/value/map/XQMap.java:630— XQMap.deepEqual has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.attributeValue (cognitive 28) basex-core/src/main/java/org/basex/query/QueryParser.java:3609— QueryParser.attributeValue has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (17 pts), ternaries 1 (5 pts), loops 2 (3 pts), match/switch 1 (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.
QueryParser.dirElemContent (cognitive 28) basex-core/src/main/java/org/basex/query/QueryParser.java:3907— QueryParser.dirElemContent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 3 (13 pts), loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
XMLScanner.content (cognitive 28) basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:316— XMLScanner.content has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DirParser.parse (cognitive 28) basex-core/src/main/java/org/basex/build/DirParser.java:175— DirParser.parse has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (6 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Inspection.index (cognitive 28) basex-core/src/main/java/org/basex/data/Inspection.java:381— Inspection.index has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 4 (13 pts), if/else 5 (10 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyntaxMD.marker (cognitive 28) basex-core/src/main/java/org/basex/gui/text/SyntaxMD.java:210— SyntaxMD.marker has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (7 pts), boolean chains 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyntaxXQuery.definition (cognitive 28) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:564— SyntaxXQuery.definition has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 4 (10 pts), boolean chains 5, 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.
TreeView.markNodes (cognitive 28) basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:493— TreeView.markNodes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 5 (13 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.
FileWriteFn.write (cognitive 27) basex-core/src/main/java/org/basex/query/func/file/FileWriteFn.java:37— FileWriteFn.write has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnChar.value (cognitive 27) basex-core/src/main/java/org/basex/query/func/fn/FnChar.java:19— FnChar.value has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnParseInteger.value (cognitive 27) basex-core/src/main/java/org/basex/query/func/fn/FnParseInteger.java:21— FnParseInteger.value has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (8 pts), ternaries 5 (6 pts), error handling 1 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
XQDoc.parse (cognitive 27) basex-core/src/main/java/org/basex/query/func/inspect/XQDoc.java:43— XQDoc.parse has cognitive complexity 27 (threshold 15). Drivers by points: loops 11 (14 pts), if/else 7 (12 pts), ternaries 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Closure.optimize (cognitive 27) basex-core/src/main/java/org/basex/query/func/Closure.java:174— Closure.optimize has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (5 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimplePos.mergeEbv (cognitive 27) basex-core/src/main/java/org/basex/query/expr/SimplePos.java:118— SimplePos.mergeEbv has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 4 (7 pts), boolean chains 6 (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.
TypeCheck.optimize (cognitive 27) basex-core/src/main/java/org/basex/query/expr/TypeCheck.java:53— TypeCheck.optimize has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 8, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseXCollation.indexOf (cognitive 27) basex-core/src/main/java/org/basex/query/util/collation/BaseXCollation.java:36— BaseXCollation.indexOf has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FingerTreeIterator.next (cognitive 27) basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:194— FingerTreeIterator.next has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 2, 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. This shape REPEATS in the file: one other method here (FingerTreeIterator.previous) 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.
FingerTreeIterator.previous (cognitive 27) basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:287— FingerTreeIterator.previous has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 2, 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. This shape REPEATS in the file: one other method here (FingerTreeIterator.next) 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.
ASTVisitor.funcItems (cognitive 27) basex-core/src/main/java/org/basex/query/util/ASTVisitor.java:139— ASTVisitor.funcItems has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryError.arity (cognitive 27) basex-core/src/main/java/org/basex/query/QueryError.java:2069— QueryError.arity has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (5 pts), ternaries 1 (5 pts), boolean chains 2 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
QueryParser.skipExprContent (cognitive 27) basex-core/src/main/java/org/basex/query/QueryParser.java:3693— QueryParser.skipExprContent has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, 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.
SAXWrapper.parse (cognitive 27) basex-core/src/main/java/org/basex/build/xml/SAXWrapper.java:50— SAXWrapper.parse has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 5, boolean chains 4, error handling 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.
Data.insert (cognitive 27) basex-core/src/main/java/org/basex/data/Data.java:949— Data.insert has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (5 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseXDSlider.keyPressed (cognitive 27) basex-core/src/main/java/org/basex/gui/layout/BaseXDSlider.java:141— BaseXDSlider.keyPressed has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 2 (8 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.
BaseXPopup.<init> (cognitive 27) basex-core/src/main/java/org/basex/gui/layout/BaseXPopup.java:41— BaseXPopup.<init> has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 16). 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.
BaseXSplit.layoutContainer (cognitive 27) basex-core/src/main/java/org/basex/gui/layout/BaseXSplit.java:229— BaseXSplit.layoutContainer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextPanel.pointer (cognitive 27) basex-core/src/main/java/org/basex/gui/text/TextPanel.java:670— TextPanel.pointer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 6, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapRenderer.drawToken (cognitive 27) basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:375— MapRenderer.drawToken has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapRenderer.drawToolTip (cognitive 27) basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:634— MapRenderer.drawToolTip has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 5 (8 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapView.keyPressed (cognitive 27) basex-core/src/main/java/org/basex/gui/view/map/MapView.java:497— MapView.keyPressed has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 5 (9 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.
3.more (cognitive 27) basex-core/src/main/java/org/basex/index/query/FTIndexIterator.java:137— 3.more has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (8 pts), ternaries 2 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IOFile.normalize (cognitive 27) basex-core/src/main/java/org/basex/io/IOFile.java:944— IOFile.normalize has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 9, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GermanStemmer.subst (cognitive 27) basex-core/src/main/java/org/basex/util/ft/GermanStemmer.java:48— GermanStemmer.subst has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 6, ternaries 3 (6 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Payload.extractPart (cognitive 27) basex-core/src/main/java/org/basex/util/http/Payload.java:210— Payload.extractPart has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (5 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseXServlet.error (cognitive 26) basex-api/src/main/java/org/basex/http/BaseXServlet.java:118— BaseXServlet.error has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 3 (8 pts), error handling 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapToElement.qName (cognitive 26) basex-core/src/main/java/org/basex/query/func/fn/MapToElement.java:712— MapToElement.qName has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 10, ternaries 3 (5 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Cmp.countRange (cognitive 26) basex-core/src/main/java/org/basex/query/expr/Cmp.java:484— Cmp.countRange has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 16, if/else 10. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
1.next (cognitive 26) basex-core/src/main/java/org/basex/query/expr/IterMap.java:46— 1.next has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 1, loops 1 (nesting depth added 14). 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.
UCACollation.indexOf (cognitive 26) basex-core/src/main/java/org/basex/query/util/collation/UCACollation.java:66— UCACollation.indexOf has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FingerTree.get (cognitive 26) basex-core/src/main/java/org/basex/query/util/fingertree/FingerTree.java:56— FingerTree.get has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 5 (10 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.
Data.indexPaths (cognitive 26) basex-core/src/main/java/org/basex/data/Data.java:655— Data.indexPaths has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (2 pts), ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyntaxXQuery.completions (cognitive 26) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:492— SyntaxXQuery.completions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
TreeView.drawBigRectDescendants (cognitive 26) basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:723— TreeView.drawBigRectDescendants has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 1 (5 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonW3XmlSerializer.isNumber (cognitive 26) basex-core/src/main/java/org/basex/io/serial/json/JsonW3XmlSerializer.java:133— JsonW3XmlSerializer.isNumber has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 10, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnElementToMapPlan.value (cognitive 25) basex-core/src/main/java/org/basex/query/func/fn/FnElementToMapPlan.java:23— FnElementToMapPlan.value has cognitive complexity 25 (threshold 15). Drivers by points: loops 5 (9 pts), ternaries 4 (9 pts), if/else 2 (5 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnSum.sum (cognitive 25) basex-core/src/main/java/org/basex/query/func/fn/FnSum.java:235— FnSum.sum has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, ternaries 3 (4 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.
MapToElement.open (cognitive 25) basex-core/src/main/java/org/basex/query/func/fn/MapToElement.java:357— MapToElement.open has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5, loops 2, ternaries 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.
StringClosest.value (cognitive 25) basex-core/src/main/java/org/basex/query/func/string/StringClosest.java:46— StringClosest.value has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 5 (8 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.init (cognitive 25) basex-core/src/main/java/org/basex/query/expr/gflwor/GroupBy.java:121— 1.init has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (11 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.
Typeswitch.optimize (cognitive 25) basex-core/src/main/java/org/basex/query/expr/Typeswitch.java:60— Typeswitch.optimize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4 (7 pts), boolean chains 3, ternaries 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.
BufferNode.append (cognitive 25) basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeBuilder.java:180— BufferNode.append has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 6 (12 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.
XQMap.instanceOf (cognitive 25) basex-core/src/main/java/org/basex/query/value/map/XQMap.java:343— XQMap.instanceOf has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, ternaries 3 (6 pts), error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ClientQuery.bind (cognitive 25) basex-core/src/main/java/org/basex/api/client/ClientQuery.java:60— ClientQuery.bind has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 5 (7 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XMLParser.parse (cognitive 25) basex-core/src/main/java/org/basex/build/xml/XMLParser.java:69— XMLParser.parse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextEditor.indent (cognitive 25) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:1362— TextEditor.indent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (10 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorView.confirm (cognitive 25) basex-core/src/main/java/org/basex/gui/view/editor/EditorView.java:1184— EditorView.confirm has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 8, loops 2 (3 pts), error handling 1 (2 pts), ternaries 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.
1.keyPressed (cognitive 25) basex-core/src/main/java/org/basex/gui/GUIInput.java:50— 1.keyPressed has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (24 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.
JsonParser.number (cognitive 25) basex-core/src/main/java/org/basex/io/parse/json/JsonParser.java:286— JsonParser.number has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 8, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupSerializer.<init> (cognitive 25) basex-core/src/main/java/org/basex/io/serial/MarkupSerializer.java:70— MarkupSerializer.<init> has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 6, ternaries 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.
ClientListener.query (cognitive 25) basex-core/src/main/java/org/basex/server/ClientListener.java:384— ClientListener.query has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 1 (2 pts), error handling 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.
GreekStemmer.rule21 (cognitive 25) basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:932— GreekStemmer.rule21 has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 16, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Levenshtein.distance (cognitive 25) basex-core/src/main/java/org/basex/util/similarity/Levenshtein.java:177— Levenshtein.distance has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 4 (8 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArraySort.quickValue (cognitive 24) basex-core/src/main/java/org/basex/query/func/array/ArraySort.java:64— ArraySort.quickValue has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 14). 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.
FnFoldRight.value (cognitive 24) basex-core/src/main/java/org/basex/query/func/fn/FnFoldRight.java:20— FnFoldRight.value has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (8 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.
Ids.value (cognitive 24) basex-core/src/main/java/org/basex/query/func/fn/Ids.java:33— Ids.value has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (7 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GFLWOR.unnestFLWR (cognitive 24) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:622— GFLWOR.unnestFLWR has cognitive complexity 24 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 2 (6 pts), ternaries 1 (4 pts), boolean chains 3 (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.
Step.optimize (cognitive 24) basex-core/src/main/java/org/basex/query/expr/path/Step.java:209— Step.optimize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 10, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Linear.normalize (cognitive 24) basex-core/src/main/java/org/basex/query/expr/Linear.java:50— Linear.normalize has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 7 (8 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Rename.value (cognitive 24) basex-core/src/main/java/org/basex/query/up/expr/Rename.java:42— Rename.value has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (7 pts), boolean chains 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataUpdates.prepare (cognitive 24) basex-core/src/main/java/org/basex/query/up/DataUpdates.java:155— DataUpdates.prepare has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 6 (9 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FuncType.intersect (cognitive 24) basex-core/src/main/java/org/basex/query/value/type/FuncType.java:208— FuncType.intersect has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeqType.coerceAtomic (cognitive 24) basex-core/src/main/java/org/basex/query/value/type/SeqType.java:478— SeqType.coerceAtomic has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 15, if/else 7 (8 pts), ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ReplaceContext.replace (cognitive 24) basex-core/src/main/java/org/basex/gui/text/ReplaceContext.java:52— ReplaceContext.replace has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 2 (6 pts), boolean chains 2, 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.
TextRenderer.more (cognitive 24) basex-core/src/main/java/org/basex/gui/text/TextRenderer.java:669— TextRenderer.more has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
3.keyPressed (cognitive 24) basex-core/src/main/java/org/basex/gui/view/project/ProjectFilter.java:586— 3.keyPressed has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (5 pts), boolean chains 4 (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.
SegmentedIndex.merge (cognitive 24) basex-core/src/main/java/org/basex/index/SegmentedIndex.java:413— SegmentedIndex.merge has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 5 (8 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.
UTF8.adoptable (cognitive 24) basex-core/src/main/java/org/basex/io/in/TextDecoder.java:126— UTF8.adoptable has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonSerializer.atomic (cognitive 24) basex-core/src/main/java/org/basex/io/serial/json/JsonSerializer.java:179— JsonSerializer.atomic has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 3 (10 pts), if/else 6 (9 pts), boolean chains 4, error handling 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Client.writePayload (cognitive 24) basex-core/src/main/java/org/basex/util/http/Client.java:643— Client.writePayload has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, loops 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Options.assign (cognitive 24) basex-core/src/main/java/org/basex/util/options/Options.java:1074— Options.assign has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 4 (6 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Token.number (cognitive 24) basex-core/src/main/java/org/basex/util/Token.java:606— Token.number has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 7, ternaries 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor.loadCodeMirror (cognitive 24) basex-modules/dba/src/main/resources/static/editor.js:102— editor.loadCodeMirror has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebFunction.bind (cognitive 23) basex-api/src/main/java/org/basex/http/web/WebFunction.java:192— WebFunction.bind has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 2 (8 pts), if/else 3 (7 pts), loops 2 (5 pts), error handling 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArchiveFn.toFiles (cognitive 23) basex-core/src/main/java/org/basex/query/func/archive/ArchiveFn.java:114— ArchiveFn.toFiles has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnDistinctValues.opt (cognitive 23) basex-core/src/main/java/org/basex/query/func/fn/FnDistinctValues.java:53— FnDistinctValues.opt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DateParser.tzoffset (cognitive 23) basex-core/src/main/java/org/basex/query/func/fn/FnParseIetfDate.java:313— DateParser.tzoffset has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.next (cognitive 23) basex-core/src/main/java/org/basex/query/expr/gflwor/Window.java:113— 1.next has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 3 (8 pts), loops 2 (4 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.
CmpR.indexAccessible (cognitive 23) basex-core/src/main/java/org/basex/query/expr/CmpR.java:333— CmpR.indexAccessible has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, ternaries 3 (4 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CmpR.toString (cognitive 23) basex-core/src/main/java/org/basex/query/expr/CmpR.java:446— CmpR.toString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (6 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Range.optimize (cognitive 23) basex-core/src/main/java/org/basex/query/expr/Range.java:42— Range.optimize has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SimpleMap.optimize (cognitive 23) basex-core/src/main/java/org/basex/query/expr/SimpleMap.java:58— SimpleMap.optimize has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (12 pts), boolean chains 6, if/else 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InnerNode.insert (cognitive 23) basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:71— InnerNode.insert has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 6 (9 pts), loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
AnnList.intersect (cognitive 23) basex-core/src/main/java/org/basex/query/util/list/AnnList.java:97— AnnList.intersect has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2, 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.
XQMap.castTo (cognitive 23) basex-core/src/main/java/org/basex/query/value/map/XQMap.java:571— XQMap.castTo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 2 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ValueBuilder.add (cognitive 23) basex-core/src/main/java/org/basex/query/value/ValueBuilder.java:68— ValueBuilder.add has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (13 pts), if/else 5 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
QueryParser.updatingFunctionCall (cognitive 23) basex-core/src/main/java/org/basex/query/QueryParser.java:5115— QueryParser.updatingFunctionCall has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 1 (4 pts) (nesting depth added 16). 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.
QueryResources.open (cognitive 23) basex-core/src/main/java/org/basex/query/QueryResources.java:596— QueryResources.open has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, error handling 2 (5 pts), loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sandbox.error (cognitive 23) basex-core/src/main/java/org/basex/core/Sandbox.java:243— Sandbox.error has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 pts), ternaries 2 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Inspection.name (cognitive 23) basex-core/src/main/java/org/basex/data/Inspection.java:262— Inspection.name has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (8 pts), if/else 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyntaxXQuery.mode (cognitive 23) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:295— SyntaxXQuery.mode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 5, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TextEditor.joinLines (cognitive 23) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:1948— TextEditor.joinLines has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewContainer.calc (cognitive 23) basex-core/src/main/java/org/basex/gui/view/ViewContainer.java:236— ViewContainer.calc has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5 (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.
ViewNotifier.init (cognitive 23) basex-core/src/main/java/org/basex/gui/view/ViewNotifier.java:62— ViewNotifier.init has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (8 pts), boolean chains 4 (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.
OutputSerializer.<init> (cognitive 23) basex-core/src/main/java/org/basex/io/serial/OutputSerializer.java:48— OutputSerializer.<init> has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 4 (5 pts), error handling 1 (2 pts), loops 1 (2 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.
SerializerOptions.parse (cognitive 23) basex-core/src/main/java/org/basex/io/serial/SerializerOptions.java:204— SerializerOptions.parse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 2 (4 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XhtmlHtmlSerializer.adjustNamespaces (cognitive 23) basex-core/src/main/java/org/basex/io/serial/XhtmlHtmlSerializer.java:125— XhtmlHtmlSerializer.adjustNamespaces has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IOFile.regex (cognitive 23) basex-core/src/main/java/org/basex/io/IOFile.java:894— IOFile.regex has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Mail.send (cognitive 23) basex-modules/mail/src/main/java/org/basex/modules/Mail.java:62— Mail.send has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, loops 2 (4 pts), error handling 3, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WebModule.parse (cognitive 22) basex-api/src/main/java/org/basex/http/web/WebModule.java:60— WebModule.parse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (7 pts), boolean chains 1, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArchiveCreateFrom.create (cognitive 22) basex-core/src/main/java/org/basex/query/func/archive/ArchiveCreateFrom.java:24— ArchiveCreateFrom.create has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), boolean chains 2, error handling 1, ternaries 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.
Docs.accept (cognitive 22) basex-core/src/main/java/org/basex/query/func/fn/Docs.java:82— Docs.accept has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FnFoot.opt (cognitive 22) basex-core/src/main/java/org/basex/query/func/fn/FnFoot.java:50— FnFoot.opt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
FnSum.opt (cognitive 22) basex-core/src/main/java/org/basex/query/func/fn/FnSum.java:40— FnSum.opt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnUpdate.value (cognitive 22) basex-core/src/main/java/org/basex/query/func/fn/FnUpdate.java:44— FnUpdate.value has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
Ids.add (cognitive 22) basex-core/src/main/java/org/basex/query/func/fn/Ids.java:105— Ids.add has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 2 (10 pts), if/else 2 (6 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GFLWOR.unnestLets (cognitive 22) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:1071— GFLWOR.unnestLets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 2 (5 pts), loops 1 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
1.eval (cognitive 22) basex-core/src/main/java/org/basex/query/expr/Calc.java:25— 1.eval has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
4.eval (cognitive 22) basex-core/src/main/java/org/basex/query/expr/Calc.java:234— 4.eval has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (21 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.
CmpSR.merge (cognitive 22) basex-core/src/main/java/org/basex/query/expr/CmpSR.java:98— CmpSR.merge has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, ternaries 2 (4 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.
Unfold.iterate (cognitive 22) basex-core/src/main/java/org/basex/query/expr/Unfold.java:84— Unfold.iterate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, ternaries 3, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepoManager.packages (cognitive 22) basex-core/src/main/java/org/basex/query/util/pkg/RepoManager.java:185— RepoManager.packages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (6 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegExLexer.next (cognitive 22) basex-core/src/main/java/org/basex/query/util/regex/parse/RegExLexer.java:72— RegExLexer.next has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
5.next (cognitive 22) basex-core/src/main/java/org/basex/query/value/node/GNode.java:337— 5.next has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (10 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.skipDirElement (cognitive 22) basex-core/src/main/java/org/basex/query/QueryParser.java:3752— QueryParser.skipDirElement has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.skipStringConstructor (cognitive 22) basex-core/src/main/java/org/basex/query/QueryParser.java:3821— QueryParser.skipStringConstructor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DirParser.parseResource (cognitive 22) basex-core/src/main/java/org/basex/build/DirParser.java:244— DirParser.parseResource has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 1 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateDB.run (cognitive 22) basex-core/src/main/java/org/basex/core/cmd/CreateDB.java:45— CreateDB.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), error handling 4, boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TextEditor.forEach (cognitive 22) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:1792— TextEditor.forEach has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (5 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 10). 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.
TextEditor.prevWord (cognitive 22) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:268— TextEditor.prevWord has cognitive complexity 22 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 6 (8 pts), boolean chains 2 (nesting depth added 10). 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.
TableData.sort (cognitive 22) basex-core/src/main/java/org/basex/gui/view/table/TableData.java:240— TableData.sort has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 3 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TreeView.mousePressed (cognitive 22) basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:991— TreeView.mousePressed has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
4.execute (cognitive 22) basex-core/src/main/java/org/basex/gui/GUIMenuCmd.java:67— 4.execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathIndex.desc (cognitive 22) basex-core/src/main/java/org/basex/index/path/PathIndex.java:279— PathIndex.desc has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 3 (6 pts), ternaries 3 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CsvParser.record (cognitive 22) basex-core/src/main/java/org/basex/io/parse/csv/CsvParser.java:159— CsvParser.record has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6 (7 pts), boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableDiskAccess.delete (cognitive 22) basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:257— TableDiskAccess.delete has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (20 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.
AdaptiveSerializer.node (cognitive 22) basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java:113— AdaptiveSerializer.node has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Token.normalize (cognitive 22) basex-core/src/main/java/org/basex/util/Token.java:1296— Token.normalize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, loops 4, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 22) basex-modules/dba/src/main/resources/static/js.js:835— (anonymous) has cognitive complexity 22 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 4 (8 pts), boolean chains 4, other 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.
workspaceKeys (cognitive 22) basex-modules/dba/src/main/resources/static/workspace.js:885— workspaceKeys has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 8, ternaries 3 (6 pts) (nesting depth added 3). Of this number, 18 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
RestXqServlet.run (cognitive 21) basex-api/src/main/java/org/basex/http/restxq/RestXqServlet.java:25— RestXqServlet.run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebDAVLockUpdate.value (cognitive 21) basex-api/src/main/java/org/basex/query/func/webdav/WebDAVLockUpdate.java:21— WebDAVLockUpdate.value has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (4 pts), loops 3, 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.
MyKeySelector.select (cognitive 21) basex-core/src/main/java/org/basex/query/func/crypto/MyKeySelector.java:19— MyKeySelector.select has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 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.
DbCounts.tests (cognitive 21) basex-core/src/main/java/org/basex/query/func/db/DbCounts.java:92— DbCounts.tests has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, ternaries 1 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnLowest.value (cognitive 21) basex-core/src/main/java/org/basex/query/func/fn/FnLowest.java:36— FnLowest.value has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (8 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnMin.monotonic (cognitive 21) basex-core/src/main/java/org/basex/query/func/fn/FnMin.java:163— FnMin.monotonic has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 9, ternaries 2 (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.
FnReplicate.opt (cognitive 21) basex-core/src/main/java/org/basex/query/func/fn/FnReplicate.java:119— FnReplicate.opt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnSum.linear (cognitive 21) basex-core/src/main/java/org/basex/query/func/fn/FnSum.java:140— FnSum.linear has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MapMerge.value (cognitive 21) basex-core/src/main/java/org/basex/query/func/map/MapMerge.java:58— MapMerge.value has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 4 (7 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CElem.toString (cognitive 21) basex-core/src/main/java/org/basex/query/expr/constr/CElem.java:213— CElem.toString has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MixedPath.cached (cognitive 21) basex-core/src/main/java/org/basex/query/expr/path/MixedPath.java:49— MixedPath.cached has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), ternaries 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.
Path.get (cognitive 21) basex-core/src/main/java/org/basex/query/expr/path/Path.java:77— Path.get has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, ternaries 3 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Step.assignType (cognitive 21) basex-core/src/main/java/org/basex/query/expr/path/Step.java:259— Step.assignType has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, ternaries 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.
CmpR.get (cognitive 21) basex-core/src/main/java/org/basex/query/expr/CmpR.java:122— CmpR.get has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, ternaries 1 (2 pts), match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Linear.compare (cognitive 21) basex-core/src/main/java/org/basex/query/expr/Linear.java:95— Linear.compare has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, ternaries 3 (4 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
AtomicUpdateCache.check (cognitive 21) basex-core/src/main/java/org/basex/query/up/atomic/AtomicUpdateCache.java:210— AtomicUpdateCache.check has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5 (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.
InnerNode.remove (cognitive 21) basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java:199— InnerNode.remove has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 4, boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
IcuFormatter.ruleSet (cognitive 21) basex-core/src/main/java/org/basex/query/util/format/IcuFormatter.java:198— IcuFormatter.ruleSet has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (4 pts), ternaries 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
RdfXml.node (cognitive 21) basex-core/src/main/java/org/basex/query/util/ft/thesaurus/RdfXml.java:112— RdfXml.node has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), ternaries 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UriParser.removeDots (cognitive 21) basex-core/src/main/java/org/basex/query/util/UriParser.java:234— UriParser.removeDots has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 4 (6 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GDt.<init> (cognitive 21) basex-core/src/main/java/org/basex/query/value/item/GDt.java:63— GDt.<init> has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (7 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.
DBNode.baseURI (cognitive 21) basex-core/src/main/java/org/basex/query/value/node/DBNode.java:190— DBNode.baseURI has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
3.next (cognitive 21) basex-core/src/main/java/org/basex/query/value/node/GNode.java:255— 3.next has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DBNodeSeq.steps (cognitive 21) basex-core/src/main/java/org/basex/query/value/seq/DBNodeSeq.java:95— DBNodeSeq.steps has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (4 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.
ArrayType.union (cognitive 21) basex-core/src/main/java/org/basex/query/value/type/ArrayType.java:99— ArrayType.union has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (21 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BasicType.checkLong (cognitive 21) basex-core/src/main/java/org/basex/query/value/type/BasicType.java:930— BasicType.checkLong has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (6 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.
ShapeType.union (cognitive 21) basex-core/src/main/java/org/basex/query/value/type/ShapeType.java:379— ShapeType.union has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.declareExtension (cognitive 21) basex-core/src/main/java/org/basex/query/QueryParser.java:1255— QueryParser.declareExtension has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryResources.collection (cognitive 21) basex-core/src/main/java/org/basex/query/QueryResources.java:274— QueryResources.collection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 8, loops 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Find.split (cognitive 21) basex-core/src/main/java/org/basex/core/cmd/Find.java:123— Find.split has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XMLParser.check (cognitive 21) basex-core/src/main/java/org/basex/core/parse/XMLParser.java:254— XMLParser.check has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 3, ternaries 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NSEntries.entries (cognitive 21) basex-core/src/main/java/org/basex/data/NSEntries.java:297— NSEntries.entries has cognitive complexity 21 (threshold 15). Drivers by points: loops 7 (10 pts), if/else 4 (9 pts), boolean chains 1, ternaries 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.
NSEntries.inflate (cognitive 21) basex-core/src/main/java/org/basex/data/NSEntries.java:352— NSEntries.inflate has cognitive complexity 21 (threshold 15). Drivers by points: loops 8 (15 pts), if/else 3 (5 pts), boolean chains 1 (nesting depth added 9). 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.
Namespaces.info (cognitive 21) basex-core/src/main/java/org/basex/data/Namespaces.java:628— Namespaces.info has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyntaxXQuery.lineKeywords (cognitive 21) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:1277— SyntaxXQuery.lineKeywords has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (7 pts), boolean chains 5, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextRenderer.scan (cognitive 21) basex-core/src/main/java/org/basex/gui/text/TextRenderer.java:998— TextRenderer.scan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (4 pts), boolean chains 1, ternaries 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.
TreeView.highlightDescendants (cognitive 21) basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:675— TreeView.highlightDescendants has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (7 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IdPreMap.delete (cognitive 21) basex-core/src/main/java/org/basex/index/IdPreMap.java:370— IdPreMap.delete has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, ternaries 2 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
JsonParser.object (cognitive 21) basex-core/src/main/java/org/basex/io/parse/json/JsonParser.java:169— JsonParser.object has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, ternaries 2 (5 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Options.write (cognitive 21) basex-core/src/main/java/org/basex/util/options/Options.java:144— Options.write has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 5 (9 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JaroWinkler.dst (cognitive 21) basex-core/src/main/java/org/basex/util/similarity/JaroWinkler.java:36— JaroWinkler.dst has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 6 (7 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Cron.field (cognitive 21) basex-core/src/main/java/org/basex/util/Cron.java:160— Cron.field has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WsFunction.parseAnnotations (cognitive 20) basex-api/src/main/java/org/basex/http/ws/WsFunction.java:55— WsFunction.parseAnnotations has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseXHTTP.<init> (cognitive 20) REDACTED:70— BaseXHTTP.<init> has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), error handling 1, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DbCounts.collect (cognitive 20) basex-core/src/main/java/org/basex/query/func/db/DbCounts.java:186— DbCounts.collect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DbPut.value (cognitive 20) basex-core/src/main/java/org/basex/query/func/db/DbPut.java:24— DbPut.value has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 4 (7 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileCopy.relocate (cognitive 20) basex-core/src/main/java/org/basex/query/func/file/FileCopy.java:34— FileCopy.relocate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 8, error handling 1, ternaries 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.
FnDistinctValues.optStats (cognitive 20) basex-core/src/main/java/org/basex/query/func/fn/FnDistinctValues.java:123— FnDistinctValues.optStats has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnSort.opt (cognitive 20) basex-core/src/main/java/org/basex/query/func/fn/FnSort.java:19— FnSort.opt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5 (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.
FnSubstring.opt (cognitive 20) basex-core/src/main/java/org/basex/query/func/fn/FnSubstring.java:33— FnSubstring.opt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6 (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.
ParseFn.doc (cognitive 20) basex-core/src/main/java/org/basex/query/func/fn/ParseFn.java:113— ParseFn.doc has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 5 (6 pts), error handling 3, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InspectStaticContext.value (cognitive 20) basex-core/src/main/java/org/basex/query/func/inspect/InspectStaticContext.java:24— InspectStaticContext.value has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (11 pts), if/else 5 (6 pts), loops 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
SqlExecutePrepared.setParameters (cognitive 20) basex-core/src/main/java/org/basex/query/func/sql/SqlExecutePrepared.java:80— SqlExecutePrepared.setParameters has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UtilCountWithin.ebv (cognitive 20) basex-core/src/main/java/org/basex/query/func/util/UtilCountWithin.java:35— UtilCountWithin.ebv has cognitive complexity 20 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 5 (6 pts), boolean chains 4, ternaries 1 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
StandardFunc.toJobSpec (cognitive 20) basex-core/src/main/java/org/basex/query/func/StandardFunc.java:739— StandardFunc.toJobSpec has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (5 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.
FTFilter.select (cognitive 20) basex-core/src/main/java/org/basex/query/expr/ft/FTFilter.java:117— FTFilter.select has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FTWords.contains (cognitive 20) basex-core/src/main/java/org/basex/query/expr/ft/FTWords.java:328— FTWords.contains has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (8 pts), boolean chains 5, if/else 3 (4 pts), loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GFLWOR.countToWhile (cognitive 20) basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java:909— GFLWOR.countToWhile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
3.eval (cognitive 20) basex-core/src/main/java/org/basex/query/expr/Calc.java:169— 3.eval has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 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.
CmpG.compare (cognitive 20) basex-core/src/main/java/org/basex/query/expr/CmpG.java:423— CmpG.compare has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CmpIR.get (cognitive 20) basex-core/src/main/java/org/basex/query/expr/CmpIR.java:71— CmpIR.get has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 9, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
List.simplifyFor (cognitive 20) basex-core/src/main/java/org/basex/query/expr/List.java:241— List.simplifyFor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Try.optimize (cognitive 20) basex-core/src/main/java/org/basex/query/expr/Try.java:74— Try.optimize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DBOptions.<init> (cognitive 20) basex-core/src/main/java/org/basex/query/up/primitives/DBOptions.java:41— DBOptions.<init> has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathNodes.get (cognitive 20) basex-core/src/main/java/org/basex/query/util/index/PathNodes.java:55— PathNodes.get has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Dec.parse (cognitive 20) basex-core/src/main/java/org/basex/query/value/item/Dec.java:179— Dec.parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 1 (2 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.
FElem.nsScope (cognitive 20) basex-core/src/main/java/org/basex/query/value/node/FElem.java:185— FElem.nsScope has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FNode.compare (cognitive 20) basex-core/src/main/java/org/basex/query/value/node/FNode.java:58— FNode.compare has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 4, boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XNode.nsScope (cognitive 20) basex-core/src/main/java/org/basex/query/value/node/XNode.java:359— XNode.nsScope has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (7 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.
TreeSeqBuilder.addSequence (cognitive 20) basex-core/src/main/java/org/basex/query/value/seq/tree/TreeSeqBuilder.java:106— TreeSeqBuilder.addSequence has cognitive complexity 20 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 3, ternaries 1 (3 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ItrSeq.simplifyFor (cognitive 20) basex-core/src/main/java/org/basex/query/value/seq/ItrSeq.java:115— ItrSeq.simplifyFor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (9 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.
RangeSeq.optimizePos (cognitive 20) basex-core/src/main/java/org/basex/query/value/seq/RangeSeq.java:168— RangeSeq.optimizePos has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 4 (8 pts), boolean chains 2, 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.
Builder.add (cognitive 20) basex-core/src/main/java/org/basex/query/value/type/ChoiceItemType.java:256— Builder.add has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShapeType.instanceOf (cognitive 20) basex-core/src/main/java/org/basex/query/value/type/ShapeType.java:314— ShapeType.instanceOf has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.check (cognitive 20) basex-core/src/main/java/org/basex/query/QueryParser.java:376— QueryParser.check has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 5 (6 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.eQName (cognitive 20) basex-core/src/main/java/org/basex/query/QueryParser.java:5162— QueryParser.eQName has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (20 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
QueryParser.groupSpecs (cognitive 20) basex-core/src/main/java/org/basex/query/QueryParser.java:1845— QueryParser.groupSpecs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 2 (3 pts), ternaries 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.
Find.query (cognitive 20) basex-core/src/main/java/org/basex/core/cmd/Find.java:31— Find.query has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DialogImport.action (cognitive 20) basex-core/src/main/java/org/basex/gui/dialog/DialogImport.java:147— DialogImport.action has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 5, if/else 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.keyReleased (cognitive 20) basex-core/src/main/java/org/basex/gui/layout/BaseXList.java:121— 1.keyReleased has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (2 pts), ternaries 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.
SearchBar.<init> (cognitive 20) basex-core/src/main/java/org/basex/gui/text/SearchBar.java:82— SearchBar.<init> has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TextEditor.call (cognitive 20) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:668— TextEditor.call has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, ternaries 2 (3 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectFilter.replace (cognitive 20) basex-core/src/main/java/org/basex/gui/view/project/ProjectFilter.java:293— ProjectFilter.replace has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 6 (7 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
TableHeader.paintComponent (cognitive 20) basex-core/src/main/java/org/basex/gui/view/table/TableHeader.java:82— TableHeader.paintComponent has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 6, if/else 4 (6 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewContainer.buildLayout (cognitive 20) basex-core/src/main/java/org/basex/gui/view/ViewContainer.java:297— ViewContainer.buildLayout has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Docs.docs (cognitive 20) basex-core/src/main/java/org/basex/index/resource/Docs.java:235— Docs.docs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableDiskAccess.flush (cognitive 20) basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:103— TableDiskAccess.flush has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 5 (6 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 6). 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.
TableDiskAccess.insert (cognitive 20) basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:331— TableDiskAccess.insert has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 3 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AdaptiveSerializer.array (cognitive 20) basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java:212— AdaptiveSerializer.array has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Client.send (cognitive 20) basex-core/src/main/java/org/basex/util/http/Client.java:189— Client.send has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, ternaries 2 (3 pts), error handling 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Compress.pack (cognitive 20) basex-core/src/main/java/org/basex/util/Compress.java:26— Compress.pack has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
workspace.closeTab (cognitive 20) basex-modules/dba/src/main/resources/static/workspace.js:265— workspace.closeTab has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnAnalyzeString.match (cognitive 19) basex-core/src/main/java/org/basex/query/func/fn/FnAnalyzeString.java:72— FnAnalyzeString.match has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), boolean chains 1, ternaries 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.
FnTranslate.value (cognitive 19) basex-core/src/main/java/org/basex/query/func/fn/FnTranslate.java:19— FnTranslate.value has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnUpdate.supply (cognitive 19) basex-core/src/main/java/org/basex/query/func/fn/FnUpdate.java:173— FnUpdate.supply has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 2 (8 pts), if/else 4 (5 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapToElement.object (cognitive 19) basex-core/src/main/java/org/basex/query/func/fn/MapToElement.java:207— MapToElement.object has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PlanFn.decode (cognitive 19) basex-core/src/main/java/org/basex/query/func/fn/PlanFn.java:351— PlanFn.decode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapMerge.opt (cognitive 19) basex-core/src/main/java/org/basex/query/func/map/MapMerge.java:93— MapMerge.opt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 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.
StaticFuncs.similarError (cognitive 19) basex-core/src/main/java/org/basex/query/func/StaticFuncs.java:370— StaticFuncs.similarError has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 2 (4 pts), ternaries 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.
CAttr.value (cognitive 19) basex-core/src/main/java/org/basex/query/expr/constr/CAttr.java:53— CAttr.value has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6 (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.
CMap.value (cognitive 19) basex-core/src/main/java/org/basex/query/expr/constr/CMap.java:151— CMap.value has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (9 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.
1.sort (cognitive 19) basex-core/src/main/java/org/basex/query/expr/gflwor/OrderBy.java:78— 1.sort has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (8 pts), if/else 2 (5 pts), ternaries 2 (4 pts), error handling 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.
Path.toUnion (cognitive 19) basex-core/src/main/java/org/basex/query/expr/path/Path.java:845— Path.toUnion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SelectorStep.optimize (cognitive 19) basex-core/src/main/java/org/basex/query/expr/path/SelectorStep.java:127— SelectorStep.optimize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Step.rootToString (cognitive 19) basex-core/src/main/java/org/basex/query/expr/path/Step.java:648— Step.rootToString has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
2.eval (cognitive 19) basex-core/src/main/java/org/basex/query/expr/Calc.java:99— 2.eval has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CmpG.mergeEbv (cognitive 19) basex-core/src/main/java/org/basex/query/expr/CmpG.java:506— CmpG.mergeEbv has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SimpleMap.dropOps (cognitive 19) basex-core/src/main/java/org/basex/query/expr/SimpleMap.java:362— SimpleMap.dropOps has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, loops 1, ternaries 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.
NodeUpdates.finish (cognitive 19) basex-core/src/main/java/org/basex/query/up/NodeUpdates.java:78— NodeUpdates.finish has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.formatDate (cognitive 19) basex-core/src/main/java/org/basex/query/util/format/Formatter.java:156— Formatter.formatDate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 4 (7 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.formatInt (cognitive 19) basex-core/src/main/java/org/basex/query/util/format/Formatter.java:435— Formatter.formatInt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 3 (4 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.
IcuFormatter.ruleSet (cognitive 19) basex-core/src/main/java/org/basex/query/util/format/IcuFormatter.java:259— IcuFormatter.ruleSet has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ModuleLoader.addImport (cognitive 19) basex-core/src/main/java/org/basex/query/util/pkg/ModuleLoader.java:77— ModuleLoader.addImport has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 3, boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapBuilder.put (cognitive 19) basex-core/src/main/java/org/basex/query/value/map/MapBuilder.java:56— MapBuilder.put has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.ftPrimary (cognitive 19) basex-core/src/main/java/org/basex/query/QueryParser.java:4741— QueryParser.ftPrimary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 3 (6 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
QueryParser.inlineFunction (cognitive 19) basex-core/src/main/java/org/basex/query/QueryParser.java:3021— QueryParser.inlineFunction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.multiplicative (cognitive 19) basex-core/src/main/java/org/basex/query/QueryParser.java:2180— QueryParser.multiplicative has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (14 pts), boolean chains 2, if/else 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
QueryParser.skipAttrValue (cognitive 19) basex-core/src/main/java/org/basex/query/QueryParser.java:3657— QueryParser.skipAttrValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryResources.openCollection (cognitive 19) basex-core/src/main/java/org/basex/query/QueryResources.java:351— QueryResources.openCollection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (3 pts), ternaries 2, 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.
XMLScanner.attValue (cognitive 19) basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:291— XMLScanner.attValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XMLScanner.extSubsetDecl (cognitive 19) basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:774— XMLScanner.extSubsetDecl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Data.replace (cognitive 19) basex-core/src/main/java/org/basex/data/Data.java:790— Data.replace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DialogPackages.action (cognitive 19) basex-core/src/main/java/org/basex/gui/dialog/DialogPackages.java:98— DialogPackages.action has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextEditor.bracket (cognitive 19) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:624— TextEditor.bracket has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextEditor.tidy (cognitive 19) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:808— TextEditor.tidy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 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.
SplitAlgo.calcMap (cognitive 19) basex-core/src/main/java/org/basex/gui/view/map/SplitAlgo.java:35— SplitAlgo.calcMap has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (4 pts), boolean chains 3, ternaries 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StripAlgo.calcMap (cognitive 19) basex-core/src/main/java/org/basex/gui/view/map/StripAlgo.java:11— StripAlgo.calcMap has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 3 (6 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableIterator.more (cognitive 19) basex-core/src/main/java/org/basex/gui/view/table/TableIterator.java:56— TableIterator.more has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
2.more (cognitive 19) basex-core/src/main/java/org/basex/index/query/FTIndexIterator.java:50— 2.more has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CsvSerializer.record (cognitive 19) basex-core/src/main/java/org/basex/io/serial/csv/CsvSerializer.java:120— CsvSerializer.record has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonNodeSerializer.attribute (cognitive 19) basex-core/src/main/java/org/basex/io/serial/json/JsonNodeSerializer.java:141— JsonNodeSerializer.attribute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonW3XmlSerializer.escape (cognitive 19) basex-core/src/main/java/org/basex/io/serial/json/JsonW3XmlSerializer.java:272— JsonW3XmlSerializer.escape has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (6 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AdaptiveSerializer.map (cognitive 19) basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java:241— AdaptiveSerializer.map has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IOFile.transfer (cognitive 19) basex-core/src/main/java/org/basex/io/IOFile.java:703— IOFile.transfer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 1 (4 pts), loops 1 (2 pts), boolean chains 1, ternaries 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.
IndonesianStemmer.remSecondPrefix (cognitive 19) basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:283— IndonesianStemmer.remSecondPrefix has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6 (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.
Token.toInt (cognitive 19) basex-core/src/main/java/org/basex/util/Token.java:706— Token.toInt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, loops 3, ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Token.toLong) 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.
Token.toLong (cognitive 19) basex-core/src/main/java/org/basex/util/Token.java:682— Token.toLong has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, loops 3, ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Token.toInt) 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.
XMLToken.decodeUri (cognitive 19) basex-core/src/main/java/org/basex/util/XMLToken.java:419— XMLToken.decodeUri has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4 (6 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DbCounts.value (cognitive 18) basex-core/src/main/java/org/basex/query/func/db/DbCounts.java:41— DbCounts.value has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (7 pts), if/else 4 (6 pts), ternaries 4, boolean chains 1 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FileList.list (cognitive 18) basex-core/src/main/java/org/basex/query/func/file/FileList.java:55— FileList.list has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 1 (3 pts), boolean chains 2, error handling 2, 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.
ElementToMap.nodeName (cognitive 18) basex-core/src/main/java/org/basex/query/func/fn/ElementToMap.java:344— ElementToMap.nodeName has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (16 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.
FnNot.invert (cognitive 18) basex-core/src/main/java/org/basex/query/func/fn/FnNot.java:43— FnNot.invert has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlanFn.children (cognitive 18) basex-core/src/main/java/org/basex/query/func/fn/PlanFn.java:498— PlanFn.children has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (7 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SaxonTransform.invoke (cognitive 18) basex-core/src/main/java/org/basex/query/func/fn/SaxonTransform.java:166— SaxonTransform.invoke has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Inspect.doc (cognitive 18) basex-core/src/main/java/org/basex/query/func/inspect/Inspect.java:201— Inspect.doc has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (5 pts), ternaries 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Path.axis (cognitive 18) basex-core/src/main/java/org/basex/query/expr/path/Path.java:621— Path.axis has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (5 pts), boolean chains 4, 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.
Path.flatten (cognitive 18) basex-core/src/main/java/org/basex/query/expr/path/Path.java:379— Path.flatten has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HoistedFilter.value (cognitive 18) basex-core/src/main/java/org/basex/query/expr/HoistedFilter.java:29— HoistedFilter.value has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Instance.ebv (cognitive 18) basex-core/src/main/java/org/basex/query/expr/Instance.java:66— Instance.ebv has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lookup.opt (cognitive 18) basex-core/src/main/java/org/basex/query/expr/Lookup.java:110— Lookup.opt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (6 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Mapping.merge (cognitive 18) basex-core/src/main/java/org/basex/query/expr/Mapping.java:197— Mapping.merge has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, ternaries 1 (2 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.
AtomicUpdateCache.find (cognitive 18) basex-core/src/main/java/org/basex/query/up/atomic/AtomicUpdateCache.java:384— AtomicUpdateCache.find has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 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.
DataUpdates.checkNames (cognitive 18) basex-core/src/main/java/org/basex/query/up/DataUpdates.java:331— DataUpdates.checkNames has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseXCollationOptions.collator (cognitive 18) basex-core/src/main/java/org/basex/query/util/collation/BaseXCollationOptions.java:93— BaseXCollationOptions.collator has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.formatFrac (cognitive 18) basex-core/src/main/java/org/basex/query/util/format/Formatter.java:379— Formatter.formatFrac has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FTPosData.size (cognitive 18) basex-core/src/main/java/org/basex/query/util/ft/FTPosData.java:126— FTPosData.size has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ItrSeq.refine (cognitive 18) basex-core/src/main/java/org/basex/query/value/seq/ItrSeq.java:168— ItrSeq.refine has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (6 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeqType.matched (cognitive 18) basex-core/src/main/java/org/basex/query/value/type/SeqType.java:712— SeqType.matched has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5, loops 1 (2 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.
Var.refineType (cognitive 18) basex-core/src/main/java/org/basex/query/var/Var.java:187— Var.refineType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 9). 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.
QueryContext.cache (cognitive 18) basex-core/src/main/java/org/basex/query/QueryContext.java:839— QueryContext.cache has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (5 pts), boolean chains 4, if/else 3 (4 pts), ternaries 3 (4 pts), 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.
QueryContext.trace (cognitive 18) basex-core/src/main/java/org/basex/query/QueryContext.java:629— QueryContext.trace has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 1 (3 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
QueryParser.mapConstructor (cognitive 18) basex-core/src/main/java/org/basex/query/QueryParser.java:2965— QueryParser.mapConstructor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
QueryParser.postfix (cognitive 18) basex-core/src/main/java/org/basex/query/QueryParser.java:2823— QueryParser.postfix has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.pragma (cognitive 18) basex-core/src/main/java/org/basex/query/QueryParser.java:2487— QueryParser.pragma has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.primary (cognitive 18) basex-core/src/main/java/org/basex/query/QueryParser.java:2898— QueryParser.primary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
XMLScanner.externalID (cognitive 18) basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:706— XMLScanner.externalID has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 1 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ACreate.sourceToIO (cognitive 18) basex-core/src/main/java/org/basex/core/cmd/ACreate.java:50— ACreate.sourceToIO has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, loops 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Rename.rename (cognitive 18) basex-core/src/main/java/org/basex/core/cmd/Rename.java:49— Rename.rename has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 1 (4 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetaData.normPath (cognitive 18) basex-core/src/main/java/org/basex/data/MetaData.java:251— MetaData.normPath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, 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.
DialogAppearancePrefs.action (cognitive 18) basex-core/src/main/java/org/basex/gui/dialog/DialogAppearancePrefs.java:181— DialogAppearancePrefs.action has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseXImages.file (cognitive 18) basex-core/src/main/java/org/basex/gui/layout/BaseXImages.java:116— BaseXImages.file has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 1 (3 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SyntaxMD.block (cognitive 18) basex-core/src/main/java/org/basex/gui/text/SyntaxMD.java:173— SyntaxMD.block has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 1 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextEditor.closeElem (cognitive 18) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:1203— TextEditor.closeElem has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 3 (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.
TextEditor.deletePrev (cognitive 18) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:1231— TextEditor.deletePrev has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 9). 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.
TextEditor.move (cognitive 18) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:733— TextEditor.move has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextPanel.keyTyped (cognitive 18) basex-core/src/main/java/org/basex/gui/text/TextPanel.java:1135— TextPanel.keyTyped has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
TextRenderer.paintComponent (cognitive 18) basex-core/src/main/java/org/basex/gui/text/TextRenderer.java:141— TextRenderer.paintComponent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableHeader.mouseReleased (cognitive 18) basex-core/src/main/java/org/basex/gui/view/table/TableHeader.java:261— TableHeader.mouseReleased has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Stats.toString (cognitive 18) basex-core/src/main/java/org/basex/index/stats/Stats.java:175— Stats.toString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentedValues.entries (cognitive 18) basex-core/src/main/java/org/basex/index/value/SegmentedValues.java:242— SegmentedValues.entries has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (6 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableMemAccess.block (cognitive 18) basex-core/src/main/java/org/basex/io/random/TableMemAccess.java:176— TableMemAccess.block has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Serializer.value (cognitive 18) basex-core/src/main/java/org/basex/io/serial/Serializer.java:791— Serializer.value has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GreekStemmer.rule8 (cognitive 18) basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:417— GreekStemmer.rule8 has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
JapaneseTokenizer.init (cognitive 18) basex-core/src/main/java/org/basex/util/ft/JapaneseTokenizer.java:136— JapaneseTokenizer.init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Client.error (cognitive 18) basex-core/src/main/java/org/basex/util/http/Client.java:117— Client.error has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (16 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FTToken.noDiacritics (cognitive 18) basex-core/src/main/java/org/basex/util/FTToken.java:52— FTToken.noDiacritics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (8 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.
TokenBuilder.addExt (cognitive 18) basex-core/src/main/java/org/basex/util/TokenBuilder.java:332— TokenBuilder.addExt has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Mail.attachment (cognitive 18) basex-modules/mail/src/main/java/org/basex/modules/Mail.java:189— Mail.attachment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebModules.bestQf (cognitive 17) basex-api/src/main/java/org/basex/http/web/WebModules.java:397— WebModules.bestQf has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (7 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.
WebModules.parseArchives (cognitive 17) basex-api/src/main/java/org/basex/http/web/WebModules.java:486— WebModules.parseArchives has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapToElement.matches (cognitive 17) basex-core/src/main/java/org/basex/query/func/fn/MapToElement.java:633— MapToElement.matches has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlanFn.entry (cognitive 17) basex-core/src/main/java/org/basex/query/func/fn/PlanFn.java:457— PlanFn.entry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 3 (7 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InspectFunctions.value (cognitive 17) basex-core/src/main/java/org/basex/query/func/inspect/InspectFunctions.java:26— InspectFunctions.value has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (5 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XQueryTask.computeValue (cognitive 17) basex-core/src/main/java/org/basex/query/func/xquery/XQueryTask.java:66— XQueryTask.computeValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 3 (6 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Functions.preparePlaceholders (cognitive 17) basex-core/src/main/java/org/basex/query/func/Functions.java:511— Functions.preparePlaceholders has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FTFilter.combine (cognitive 17) basex-core/src/main/java/org/basex/query/expr/ft/FTFilter.java:147— FTFilter.combine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OrderBy.compare (cognitive 17) basex-core/src/main/java/org/basex/query/expr/gflwor/OrderBy.java:195— OrderBy.compare has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Path.seqType (cognitive 17) basex-core/src/main/java/org/basex/query/expr/path/Path.java:648— Path.seqType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Path.size (cognitive 17) basex-core/src/main/java/org/basex/query/expr/path/Path.java:685— Path.size has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SelectorStep.iter (cognitive 17) basex-core/src/main/java/org/basex/query/expr/path/SelectorStep.java:54— SelectorStep.iter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Intersect.opt (cognitive 17) basex-core/src/main/java/org/basex/query/expr/Intersect.java:37— Intersect.opt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
List.toRange (cognitive 17) basex-core/src/main/java/org/basex/query/expr/List.java:291— List.toRange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Set.mergePaths (cognitive 17) basex-core/src/main/java/org/basex/query/expr/Set.java:120— Set.mergePaths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Unfold.delta (cognitive 17) basex-core/src/main/java/org/basex/query/expr/Unfold.java:362— Unfold.delta has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 2 (6 pts), boolean chains 5 (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.
UCACollation.next (cognitive 17) basex-core/src/main/java/org/basex/query/util/collation/UCACollation.java:125— UCACollation.next has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexRewrite.invertSteps (cognitive 17) basex-core/src/main/java/org/basex/query/util/index/IndexRewrite.java:201— IndexRewrite.invertSteps has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UriParser.resolve (cognitive 17) basex-core/src/main/java/org/basex/query/util/UriParser.java:200— UriParser.resolve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (8 pts) (nesting depth added 9). 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.
BigArray.removeMember (cognitive 17) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:126— BigArray.removeMember has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XQHashMap.get (cognitive 17) basex-core/src/main/java/org/basex/query/value/map/XQHashMap.java:66— XQHashMap.get has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (17 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.
BigSeq.removeItem (cognitive 17) basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:112— BigSeq.removeItem has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ItrSeq.shrink (cognitive 17) basex-core/src/main/java/org/basex/query/value/seq/ItrSeq.java:84— ItrSeq.shrink has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FuncType.union (cognitive 17) basex-core/src/main/java/org/basex/query/value/type/FuncType.java:173— FuncType.union has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StaticVar.compile (cognitive 17) basex-core/src/main/java/org/basex/query/var/StaticVar.java:51— StaticVar.compile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.moduleImport (cognitive 17) basex-core/src/main/java/org/basex/query/QueryParser.java:882— QueryParser.moduleImport has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.removeComments (cognitive 17) basex-core/src/main/java/org/basex/query/QueryParser.java:5575— QueryParser.removeComments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Add.build (cognitive 17) basex-core/src/main/java/org/basex/core/cmd/Add.java:72— Add.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, error handling 3, ternaries 2 (3 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Find.tableQuery (cognitive 17) basex-core/src/main/java/org/basex/core/cmd/Find.java:75— Find.tableQuery has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 3 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Users.read (cognitive 17) basex-core/src/main/java/org/basex/core/users/Users.java:48— Users.read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 1 (3 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.
DialogNew.action (cognitive 17) basex-core/src/main/java/org/basex/gui/dialog/DialogNew.java:112— DialogNew.action has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, ternaries 2 (3 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.
BaseXLayout.addInteraction (cognitive 17) basex-core/src/main/java/org/basex/gui/layout/BaseXLayout.java:311— BaseXLayout.addInteraction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
TextEditor.delete (cognitive 17) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:1306— TextEditor.delete has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextEditor.nextWord (cognitive 17) basex-core/src/main/java/org/basex/gui/text/TextEditor.java:247— TextEditor.nextWord has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 5 (7 pts), boolean chains 2 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
TextFont.fallback (cognitive 17) basex-core/src/main/java/org/basex/gui/text/TextFont.java:286— TextFont.fallback has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 4 (6 pts), ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextPanel.setSyntax (cognitive 17) basex-core/src/main/java/org/basex/gui/text/TextPanel.java:302— TextPanel.setSyntax has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (15 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MapRenderer.drawThumbnails (cognitive 17) basex-core/src/main/java/org/basex/gui/view/map/MapRenderer.java:154— MapRenderer.drawThumbnails has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 1 (4 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlotView.createMarkedNodes (cognitive 17) basex-core/src/main/java/org/basex/gui/view/plot/PlotView.java:383— PlotView.createMarkedNodes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlotView.mousePressed (cognitive 17) basex-core/src/main/java/org/basex/gui/view/plot/PlotView.java:1001— PlotView.mousePressed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TreeView.drawRectangle (cognitive 17) basex-core/src/main/java/org/basex/gui/view/tree/TreeView.java:331— TreeView.drawRectangle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, ternaries 1 (2 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathIndex.stats (cognitive 17) basex-core/src/main/java/org/basex/index/path/PathIndex.java:239— PathIndex.stats has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemValues.idRange (cognitive 17) basex-core/src/main/java/org/basex/index/value/MemValues.java:85— MemValues.idRange has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IdPreMap.write (cognitive 17) basex-core/src/main/java/org/basex/index/IdPreMap.java:124— IdPreMap.write has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 1 (4 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TarInputStream.pax (cognitive 17) basex-core/src/main/java/org/basex/io/in/TarInputStream.java:120— TarInputStream.pax has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientListener.run (cognitive 17) basex-core/src/main/java/org/basex/server/ClientListener.java:90— ClientListener.run has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 4 (7 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Log.noTargets (cognitive 17) basex-core/src/main/java/org/basex/util/log/Log.java:176— Log.noTargets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Options.serialize (cognitive 17) basex-core/src/main/java/org/basex/util/options/Options.java:596— Options.serialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Options.toMap (cognitive 17) basex-core/src/main/java/org/basex/util/options/Options.java:1214— Options.toMap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Cron.next (cognitive 17) basex-core/src/main/java/org/basex/util/Cron.java:70— Cron.next has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 6 (7 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.
XMLToken.isNCStartChar (cognitive 17) basex-core/src/main/java/org/basex/util/XMLToken.java:148— XMLToken.isNCStartChar has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 14, ternaries 2 (3 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
WebModules.noMatch (cognitive 16) basex-api/src/main/java/org/basex/http/web/WebModules.java:139— WebModules.noMatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArchiveOptions.value (cognitive 16) basex-core/src/main/java/org/basex/query/func/archive/ArchiveOptions.java:22— ArchiveOptions.value has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 1, error handling 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.
ArchiveRefresh.value (cognitive 16) basex-core/src/main/java/org/basex/query/func/archive/ArchiveRefresh.java:27— ArchiveRefresh.value has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (3 pts), error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Docs.check (cognitive 16) basex-core/src/main/java/org/basex/query/func/fn/Docs.java:115— Docs.check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnDuplicateValues.opt (cognitive 16) basex-core/src/main/java/org/basex/query/func/fn/FnDuplicateValues.java:37— FnDuplicateValues.opt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 8). 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.
FnFoldLeft.unroll (cognitive 16) basex-core/src/main/java/org/basex/query/func/fn/FnFoldLeft.java:94— FnFoldLeft.unroll has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnRemove.opt (cognitive 16) basex-core/src/main/java/org/basex/query/func/fn/FnRemove.java:111— FnRemove.opt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FnTypeOf.toString (cognitive 16) basex-core/src/main/java/org/basex/query/func/fn/FnTypeOf.java:28— FnTypeOf.toString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
FnUpdate.jvalue (cognitive 16) basex-core/src/main/java/org/basex/query/func/fn/FnUpdate.java:416— FnUpdate.jvalue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.next (cognitive 16) basex-core/src/main/java/org/basex/query/func/sql/SqlExecute.java:111— 1.next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (4 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.
Xslt.transformer (cognitive 16) REDACTED:193— Xslt.transformer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Functions.item (cognitive 16) basex-core/src/main/java/org/basex/query/func/Functions.java:178— Functions.item has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StaticFuncs.setFunc (cognitive 16) basex-core/src/main/java/org/basex/query/func/StaticFuncs.java:103— StaticFuncs.setFunc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CNode.simplifyFor (cognitive 16) basex-core/src/main/java/org/basex/query/expr/constr/CNode.java:99— CNode.simplifyFor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (5 pts), boolean chains 4 (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.
FTDistance.filter (cognitive 16) basex-core/src/main/java/org/basex/query/expr/ft/FTDistance.java:66— FTDistance.filter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
2.next (cognitive 16) basex-core/src/main/java/org/basex/query/expr/gflwor/Window.java:155— 2.next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynamicStep.rewrite (cognitive 16) basex-core/src/main/java/org/basex/query/expr/path/DynamicStep.java:52— DynamicStep.rewrite has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 3, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Path.optimize (cognitive 16) basex-core/src/main/java/org/basex/query/expr/path/Path.java:176— Path.optimize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
5.optimize (cognitive 16) basex-core/src/main/java/org/basex/query/expr/Calc.java:321— 5.optimize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Concat.optimize (cognitive 16) basex-core/src/main/java/org/basex/query/expr/Concat.java:54— Concat.optimize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashFilter.indexed (cognitive 16) basex-core/src/main/java/org/basex/query/expr/HashFilter.java:49— HashFilter.indexed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AtomicUpdateCache.resolveTextAdjacency (cognitive 16) basex-core/src/main/java/org/basex/query/up/atomic/AtomicUpdateCache.java:446— AtomicUpdateCache.resolveTextAdjacency has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DBNew.build (cognitive 16) basex-core/src/main/java/org/basex/query/up/primitives/DBNew.java:125— DBNew.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 3, if/else 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DBNew.copy (cognitive 16) basex-core/src/main/java/org/basex/query/up/primitives/DBNew.java:201— DBNew.copy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeUpdateComparator.compare (cognitive 16) basex-core/src/main/java/org/basex/query/up/NodeUpdateComparator.java:78— NodeUpdateComparator.compare has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 4, ternaries 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AnnList.check (cognitive 16) basex-core/src/main/java/org/basex/query/util/list/AnnList.java:146— AnnList.check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XQArray.instanceOf (cognitive 16) basex-core/src/main/java/org/basex/query/value/array/XQArray.java:305— XQArray.instanceOf has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Dbl.compare (cognitive 16) basex-core/src/main/java/org/basex/query/value/item/Dbl.java:152— Dbl.compare has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (15 pts), boolean chains 1 (nesting depth added 9). 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.
4.next (cognitive 16) basex-core/src/main/java/org/basex/query/value/node/DBNode.java:397— 4.next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (4 pts), ternaries 1 (2 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.
FElem.build (cognitive 16) basex-core/src/main/java/org/basex/query/value/node/FElem.java:87— FElem.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlnSeq.simplifyFor (cognitive 16) basex-core/src/main/java/org/basex/query/value/seq/BlnSeq.java:84— BlnSeq.simplifyFor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EnumType.union (cognitive 16) basex-core/src/main/java/org/basex/query/value/type/EnumType.java:99— EnumType.union has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4, loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryContext.compile (cognitive 16) basex-core/src/main/java/org/basex/query/QueryContext.java:397— QueryContext.compile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), error handling 2 (3 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryParser.path (cognitive 16) basex-core/src/main/java/org/basex/query/QueryParser.java:2546— QueryParser.path has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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.
QueryParser.typeswitch (cognitive 16) basex-core/src/main/java/org/basex/query/QueryParser.java:1944— QueryParser.typeswitch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonParserOptions.check (cognitive 16) basex-core/src/main/java/org/basex/build/json/JsonParserOptions.java:85— JsonParserOptions.check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
XMLScanner.consume (cognitive 16) basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:596— XMLScanner.consume has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateBackup.backup (cognitive 16) basex-core/src/main/java/org/basex/core/cmd/CreateBackup.java:93— CreateBackup.backup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (6 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Put.put (cognitive 16) basex-core/src/main/java/org/basex/core/cmd/Put.java:70— Put.put has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (5 pts), ternaries 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.
DiskData.write (cognitive 16) basex-core/src/main/java/org/basex/data/DiskData.java:137— DiskData.write has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 4, ternaries 3, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
BaseXLayout.fromClipboard (cognitive 16) basex-core/src/main/java/org/basex/gui/layout/BaseXLayout.java:201— BaseXLayout.fromClipboard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 2 (5 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Completions.candidates (cognitive 16) basex-core/src/main/java/org/basex/gui/text/Completions.java:21— Completions.candidates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (7 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyntaxJSON.mode (cognitive 16) basex-core/src/main/java/org/basex/gui/text/SyntaxJSON.java:46— SyntaxJSON.mode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyntaxXQuery.outline (cognitive 16) basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java:606— SyntaxXQuery.outline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (4 pts), error handling 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FolderIterator.moreData (cognitive 16) basex-core/src/main/java/org/basex/gui/view/folder/FolderIterator.java:111— FolderIterator.moreData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapView.zoom (cognitive 16) basex-core/src/main/java/org/basex/gui/view/map/MapView.java:380— MapView.zoom has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlotAxis.calcCaption (cognitive 16) basex-core/src/main/java/org/basex/gui/view/plot/PlotAxis.java:316— PlotAxis.calcCaption has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectFiles.filter (cognitive 16) basex-core/src/main/java/org/basex/gui/view/project/ProjectFiles.java:98— ProjectFiles.filter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectFiles.parse (cognitive 16) basex-core/src/main/java/org/basex/gui/view/project/ProjectFiles.java:135— ProjectFiles.parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (5 pts), ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TreeNodeCache.<init> (cognitive 16) basex-core/src/main/java/org/basex/gui/view/tree/TreeNodeCache.java:25— TreeNodeCache.<init> has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 1 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FTSegment.collect (cognitive 16) basex-core/src/main/java/org/basex/index/ft/FTSegment.java:132— FTSegment.collect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Generic.read (cognitive 16) basex-core/src/main/java/org/basex/io/in/TextDecoder.java:175— Generic.read has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CsvSerializer.w3 (cognitive 16) basex-core/src/main/java/org/basex/io/serial/csv/CsvSerializer.java:202— CsvSerializer.w3 has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 1, error handling 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.
IO.get (cognitive 16) basex-core/src/main/java/org/basex/io/IO.java:149— IO.get has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WesternTokenizer.info (cognitive 16) basex-core/src/main/java/org/basex/util/ft/WesternTokenizer.java:261— WesternTokenizer.info has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Client.challenges (cognitive 16) basex-core/src/main/java/org/basex/util/http/Client.java:507— Client.challenges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Payload.value (cognitive 16) basex-core/src/main/java/org/basex/util/http/Payload.java:440— Payload.value has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RequestOptions.request (cognitive 16) basex-core/src/main/java/org/basex/util/http/RequestOptions.java:72— RequestOptions.request 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.
RequestParser.parseMultipart (cognitive 16) basex-core/src/main/java/org/basex/util/http/RequestParser.java:147— RequestParser.parseMultipart has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Token.toDecimal (cognitive 16) basex-core/src/main/java/org/basex/util/Token.java:637— Token.toDecimal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseXServer.<init> (cognitive 16) REDACTED:86— BaseXServer.<init> has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3, boolean chains 1, loops 1, ternaries 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.
logEntries (cognitive 16) basex-modules/dba/src/main/resources/static/logs.js:18— logEntries has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (7 pts), if/else 5, boolean chains 4 (nesting depth added 1). Of this number, 15 points are the body's own statements and 1 belongs to 7 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Change-coupling hub: XQMap.java → TrieBranch.java, TrieLeaf.java, TrieList.java basex-core/src/main/java/org/basex/query/value/map/XQMap.java— `basex-core/src/main/java/org/basex/query/value/map/XQMap.java` changes together with 3 other files — `basex-core/src/main/java/org/basex/query/value/map/TrieBranch.java`, `basex-core/src/main/java/org/basex/query/value/map/TrieLeaf.java`, `basex-core/src/main/java/org/basex/query/value/map/TrieList.java` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication· Near-duplicate member family (4 members, 19 shared lines) · ×1
Near-duplicate member family (4 members, 19 shared lines) basex-core/src/main/java/org/basex/util/list/IntList.java:400— basex-core/src/main/java/org/basex/util/list/IntList.java:400-452 | basex-core/src/main/java/org/basex/util/list/IntList.java:461-513 | basex-core/src/main/java/org/basex/util/list/IntList.java:522-574 | basex-core/src/main/java/org/basex/util/list/IntList.java:583-635 — These 4 members are variants of one another: a block of 19 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Near-duplicate member pair (41 shared lines) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:104— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:104-181 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:104-181 — These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (32 shared lines) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:250— basex-core/src/main/java/org/basex/query/value/array/BigArray.java:250-369 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:242-363 — These two members are variants of one another: 32 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (28 shared lines) basex-core/src/main/java/org/basex/gui/view/map/SquarifiedAlgo.java:11— basex-core/src/main/java/org/basex/gui/view/map/SquarifiedAlgo.java:11-82 | basex-core/src/main/java/org/basex/gui/view/map/StripAlgo.java:11-74 — These two members are variants of one another: 28 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (26 shared lines) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:42— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:42-93 | basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:42-93 — These two members are variants of one another: 26 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 (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) basex-core/src/main/java/org/basex/util/list/BoolList.java:54— basex-core/src/main/java/org/basex/util/list/BoolList.java:54-65 | basex-core/src/main/java/org/basex/util/list/DoubleList.java:54-65 | basex-core/src/main/java/org/basex/util/list/FloatList.java:54-65 | basex-core/src/main/java/org/basex/util/list/IntList.java:64-75 | basex-core/src/main/java/org/basex/util/list/LongList.java:54-65 | basex-core/src/main/java/org/basex/util/list/ShortList.java:54-65 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Edited copy of a member (122 corresponding lines) · ×1
Edited copy of a member (122 corresponding lines) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:126— basex-core/src/main/java/org/basex/query/value/array/BigArray.java:126-247 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:112-239 — These two members are one piece of code written twice and then edited apart: 122 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (80 corresponding lines) · ×1
Edited copy of a member (80 corresponding lines) basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:194— basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:194-273 | basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java:287-369 — These two members are one piece of code written twice and then edited apart: 80 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:436— basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:436-498 | basex-core/src/main/java/org/basex/query/util/fingertree/DeepTree.java:505-564 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (90 corresponding lines) · ×1
Edited copy of a member (90 corresponding lines) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:395— basex-core/src/main/java/org/basex/query/value/array/BigArray.java:395-484 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:411-504 — These two members are one piece of code written twice and then edited apart: 90 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) basex-core/src/main/java/org/basex/core/cmd/Dir.java:35— basex-core/src/main/java/org/basex/core/cmd/Dir.java:35-73 | basex-core/src/main/java/org/basex/query/func/db/DbDir.java:26-62 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnTail.java:69— basex-core/src/main/java/org/basex/query/func/fn/FnTail.java:69-111 | basex-core/src/main/java/org/basex/query/func/fn/FnTrunk.java:86-126 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Calc.java:170— basex-core/src/main/java/org/basex/query/expr/Calc.java:170-195 | basex-core/src/main/java/org/basex/query/expr/Calc.java:235-265 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnForEachPair.java:21— basex-core/src/main/java/org/basex/query/func/fn/FnForEachPair.java:21-53 | basex-core/src/main/java/org/basex/query/func/map/MapForEach.java:22-55 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 30+ corresponding lines) · ×1
Edited copies of one member (3 members, 30+ corresponding lines) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:184— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:184-216 | basex-core/src/main/java/org/basex/query/value/array/PartialLeafNode.java:28-63 | basex-core/src/main/java/org/basex/query/value/seq/tree/PartialLeafNode.java:28-57 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) basex-core/src/main/java/org/basex/io/random/DataAccess.java:409— basex-core/src/main/java/org/basex/io/random/DataAccess.java:409-436 | basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:484-511 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) basex-core/src/main/java/org/basex/query/value/node/GNode.java:250— basex-core/src/main/java/org/basex/query/value/node/GNode.java:250-276 | basex-core/src/main/java/org/basex/query/value/node/GNode.java:332-359 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (50 corresponding lines) · ×1
Edited copy of a member (50 corresponding lines) basex-core/src/main/java/org/basex/query/value/array/XQArray.java:207— basex-core/src/main/java/org/basex/query/value/array/XQArray.java:207-256 | basex-core/src/main/java/org/basex/query/value/seq/tree/SmallSeq.java:104-153 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) basex-core/src/main/java/org/basex/core/cmd/AlterDB.java:35— basex-core/src/main/java/org/basex/core/cmd/AlterDB.java:35-56 | basex-core/src/main/java/org/basex/core/cmd/Copy.java:41-64 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) basex-core/src/main/java/org/basex/query/expr/Except.java:104— basex-core/src/main/java/org/basex/query/expr/Except.java:104-127 | basex-core/src/main/java/org/basex/query/expr/Union.java:86-109 — 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) basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java:212— basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java:212-234 | basex-core/src/main/java/org/basex/io/serial/AdaptiveSerializer.java:241-269 — 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 copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:558— basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:558-577 | basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:852-873 | basex-core/src/main/java/org/basex/util/ft/GreekStemmer.java:888-909 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 11+ corresponding lines) · ×1
Edited copies of one member (4 members, 11+ corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnFilter.java:20— basex-core/src/main/java/org/basex/query/func/fn/FnFilter.java:20-31 | basex-core/src/main/java/org/basex/query/func/fn/FnForEach.java:21-32 | basex-core/src/main/java/org/basex/query/func/fn/FnForEachPair.java:56-66 | basex-core/src/main/java/org/basex/query/func/fn/FnIndexWhere.java:20-31 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×1
Edited copy of a member (36 corresponding lines) basex-api/src/main/c#/QueryBindExample.cs:17— basex-api/src/main/c#/QueryBindExample.cs:17-54 | basex-api/src/main/c#/QueryExample.cs:18-53 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×1
Edited copy of a member (18 corresponding lines) basex-core/src/main/java/org/basex/query/InlineContext.java:112— basex-core/src/main/java/org/basex/query/InlineContext.java:112-129 | basex-core/src/main/java/org/basex/query/func/fn/FnReplicate.java:163-181 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) basex-core/src/main/java/org/basex/query/func/array/ArrayFilter.java:19— basex-core/src/main/java/org/basex/query/func/array/ArrayFilter.java:19-29 | basex-core/src/main/java/org/basex/query/func/array/ArrayForEach.java:19-29 | basex-core/src/main/java/org/basex/query/func/array/ArrayIndexWhere.java:20-30 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 12+ corresponding lines) · ×1
Edited copies of one member (4 members, 12+ corresponding lines) basex-core/src/main/java/org/basex/query/util/hash/HashItemSet.java:102— basex-core/src/main/java/org/basex/query/util/hash/HashItemSet.java:102-117 | basex-core/src/main/java/org/basex/query/util/hash/QNmSet.java:77-90 | basex-core/src/main/java/org/basex/util/hash/IntSet.java:90-101 | basex-core/src/main/java/org/basex/util/hash/TokenSet.java:173-185 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×1
Edited copies of one member (3 members, 13+ corresponding lines) basex-core/src/main/java/org/basex/util/TokenBuilder.java:275— basex-core/src/main/java/org/basex/util/TokenBuilder.java:275-287 | basex-core/src/main/java/org/basex/util/list/IntList.java:133-145 | basex-core/src/main/java/org/basex/util/list/ObjectList.java:156-170 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×1
Edited copies of one member (4 members, 10+ corresponding lines) basex-core/src/main/java/org/basex/data/NSNode.java:169— basex-core/src/main/java/org/basex/data/NSNode.java:169-178 | basex-core/src/main/java/org/basex/index/thes/ThesIndex.java:164-173 | basex-core/src/main/java/org/basex/index/value/ValueSource.java:62-71 | basex-core/src/main/java/org/basex/query/util/ft/FTPosData.java:202-213 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) basex-core/src/main/java/org/basex/query/func/array/ArrayOfMembers.java:19— basex-core/src/main/java/org/basex/query/func/array/ArrayOfMembers.java:19-28 | basex-core/src/main/java/org/basex/query/func/fn/FnDistinctOrderedNodes.java:23-32 | basex-core/src/main/java/org/basex/query/func/fn/FnOutermost.java:44-54 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 8+ corresponding lines) · ×1
Edited copies of one member (5 members, 8+ corresponding lines) basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoEndPoint.java:18— basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoEndPoint.java:18-25 | basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoIsClosed.java:19-27 | basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoIsRing.java:19-26 | basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoNumInteriorRing.java:19-26 | basex-modules/geo/src/main/java/org/basex/query/func/geo/GeoStartPoint.java:18-25 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 5+ corresponding lines) · ×1
Edited copies of one member (4 members, 5+ corresponding lines) basex-core/src/main/java/org/basex/io/random/TableMemAccess.java:67— basex-core/src/main/java/org/basex/io/random/TableMemAccess.java:67-71 | basex-core/src/main/java/org/basex/io/random/TableMemAccess.java:74-78 | basex-core/src/main/java/org/basex/io/random/TableMemAccess.java:81-85 | basex-core/src/main/java/org/basex/io/random/TableMemAccess.java:88-92 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 5+ corresponding lines) · ×1
Edited copies of one member (5 members, 5+ corresponding lines) basex-core/src/main/java/org/basex/query/value/type/BasicType.java:529— basex-core/src/main/java/org/basex/query/value/type/BasicType.java:529-533 | basex-core/src/main/java/org/basex/query/value/type/BasicType.java:544-548 | basex-core/src/main/java/org/basex/query/value/type/BasicType.java:559-563 | basex-core/src/main/java/org/basex/query/value/type/BasicType.java:574-578 | basex-core/src/main/java/org/basex/query/value/type/BasicType.java:589-593 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 6+ corresponding lines) · ×1
Edited copies of one member (4 members, 6+ corresponding lines) basex-core/src/main/java/org/basex/query/value/seq/BlnSeq.java:64— basex-core/src/main/java/org/basex/query/value/seq/BlnSeq.java:64-69 | basex-core/src/main/java/org/basex/query/value/seq/DblSeq.java:60-65 | basex-core/src/main/java/org/basex/query/value/seq/DecSeq.java:60-65 | basex-core/src/main/java/org/basex/query/value/seq/FltSeq.java:60-65 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 6+ corresponding lines) · ×1
Edited copies of one member (6 members, 6+ corresponding lines) basex-core/src/main/java/org/basex/query/value/seq/BytSeq.java:70— basex-core/src/main/java/org/basex/query/value/seq/BytSeq.java:70-75 | basex-core/src/main/java/org/basex/query/value/seq/IntSeq.java:70-75 | basex-core/src/main/java/org/basex/query/value/seq/ItemSeq.java:50-55 | basex-core/src/main/java/org/basex/query/value/seq/LongSeq.java:71-76 | basex-core/src/main/java/org/basex/query/value/seq/ShrSeq.java:70-75 | basex-core/src/main/java/org/basex/query/value/seq/StrSeq.java:69-74 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 3+ corresponding lines) · ×1
Edited copies of one member (6 members, 3+ corresponding lines) basex-core/src/main/java/org/basex/query/expr/CmpG.java:656— basex-core/src/main/java/org/basex/query/expr/CmpG.java:656-658 | basex-core/src/main/java/org/basex/query/expr/CmpHashG.java:209-211 | basex-core/src/main/java/org/basex/query/expr/CmpN.java:76-78 | basex-core/src/main/java/org/basex/query/expr/CmpRangeG.java:42-44 | basex-core/src/main/java/org/basex/query/expr/CmpSimpleG.java:38-40 | basex-core/src/main/java/org/basex/query/expr/CmpV.java:135-137 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 4+ corresponding lines) · ×1
Edited copies of one member (6 members, 4+ corresponding lines) basex-core/src/main/java/org/basex/query/func/fn/FnDaysFromDuration.java:16— basex-core/src/main/java/org/basex/query/func/fn/FnDaysFromDuration.java:16-19 | basex-core/src/main/java/org/basex/query/func/fn/FnHoursFromDuration.java:16-19 | basex-core/src/main/java/org/basex/query/func/fn/FnMinutesFromDuration.java:16-19 | basex-core/src/main/java/org/basex/query/func/fn/FnMonthsFromDuration.java:16-19 | basex-core/src/main/java/org/basex/query/func/fn/FnSecondsFromDuration.java:16-19 | basex-core/src/main/java/org/basex/query/func/fn/FnYearsFromDuration.java:16-19 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 4+ corresponding lines) · ×1
Edited copies of one member (8 members, 4+ corresponding lines) basex-core/src/main/java/org/basex/query/value/seq/BlnSeq.java:106— basex-core/src/main/java/org/basex/query/value/seq/BlnSeq.java:106-109 | basex-core/src/main/java/org/basex/query/value/seq/BytSeq.java:98-101 | basex-core/src/main/java/org/basex/query/value/seq/DblSeq.java:79-82 | basex-core/src/main/java/org/basex/query/value/seq/DecSeq.java:80-83 | basex-core/src/main/java/org/basex/query/value/seq/FltSeq.java:84-87 | basex-core/src/main/java/org/basex/query/value/seq/IntSeq.java:90-93 | basex-core/src/main/java/org/basex/query/value/seq/LongSeq.java:91-94 | basex-core/src/main/java/org/basex/query/value/seq/ShrSeq.java:90-93 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 3+ corresponding lines) · ×1
Edited copies of one member (4 members, 3+ corresponding lines) basex-core/src/main/java/org/basex/query/expr/IntPos.java:114— basex-core/src/main/java/org/basex/query/expr/IntPos.java:114-116 | basex-core/src/main/java/org/basex/query/expr/MixedPos.java:71-73 | basex-core/src/main/java/org/basex/query/expr/Pos.java:226-228 | basex-core/src/main/java/org/basex/query/expr/SimplePos.java:156-158 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 3+ corresponding lines) · ×1
Edited copies of one member (5 members, 3+ corresponding lines) basex-core/src/main/java/org/basex/query/expr/CachedFilter.java:70— basex-core/src/main/java/org/basex/query/expr/CachedFilter.java:70-72 | basex-core/src/main/java/org/basex/query/expr/HoistedFilter.java:61-63 | basex-core/src/main/java/org/basex/query/expr/IterFilter.java:38-40 | basex-core/src/main/java/org/basex/query/expr/constr/CAttr.java:81-83 | basex-core/src/main/java/org/basex/query/expr/path/SelectorStep.java:174-177 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Duplicated block (26–28 lines × 2) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:428— basex-core/src/main/java/org/basex/query/value/array/BigArray.java:428-453 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:444-471 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/BigArray.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/BigArray.java:428` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (27 lines × 2) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:400— basex-core/src/main/java/org/basex/query/value/array/BigArray.java:400-426 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:416-442 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/BigArray.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/BigArray.java:400` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) basex-core/src/main/java/org/basex/io/random/DataAccess.java:419— basex-core/src/main/java/org/basex/io/random/DataAccess.java:419-436 | basex-core/src/main/java/org/basex/io/random/TableDiskAccess.java:494-511 — 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 `basex-core/src/main/java/org/basex/io/random/DataAccess.java:419` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–17 lines × 2) basex-core/src/main/java/org/basex/query/value/array/BigArray.java:455— basex-core/src/main/java/org/basex/query/value/array/BigArray.java:455-469 | basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java:473-489 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/array/BigArray.java` and `basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/value/array/BigArray.java:455` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 4) basex-core/src/main/java/org/basex/util/list/IntList.java:409— basex-core/src/main/java/org/basex/util/list/IntList.java:409-423 | basex-core/src/main/java/org/basex/util/list/IntList.java:470-484 | basex-core/src/main/java/org/basex/util/list/IntList.java:531-545 | basex-core/src/main/java/org/basex/util/list/IntList.java:592-606 — 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 `basex-core/src/main/java/org/basex/util/list/IntList.java:409` it begins part-way through the construct above it, so those exact lines 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) basex-core/src/main/java/org/basex/gui/view/map/SquarifiedAlgo.java:61— basex-core/src/main/java/org/basex/gui/view/map/SquarifiedAlgo.java:61-75 | basex-core/src/main/java/org/basex/gui/view/map/StripAlgo.java:55-69 — 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 `basex-core/src/main/java/org/basex/gui/view/map/SquarifiedAlgo.java:61` it begins part-way through the construct above it, so those exact lines 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–14 lines × 2) basex-core/src/main/java/org/basex/query/QueryParser.java:3662— basex-core/src/main/java/org/basex/query/QueryParser.java:3662-3675 | basex-core/src/main/java/org/basex/query/QueryParser.java:3785-3797 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/query/QueryParser.java:3662` it begins part-way through the construct above it, so those exact lines 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–13 lines × 2) basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:198— basex-core/src/main/java/org/basex/query/value/array/LeafNode.java:198-210 | basex-core/src/main/java/org/basex/query/value/array/PartialLeafNode.java:47-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (4–11 lines × 4) basex-core/src/main/java/org/basex/util/list/IntList.java:436— basex-core/src/main/java/org/basex/util/list/IntList.java:436-446 | basex-core/src/main/java/org/basex/util/list/IntList.java:497-507 | basex-core/src/main/java/org/basex/util/list/IntList.java:558-568 | basex-core/src/main/java/org/basex/util/list/IntList.java:627-630 — 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 `basex-core/src/main/java/org/basex/util/list/IntList.java:436` it begins part-way through the construct above it, so those 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `values` to `byte[][]` in one and `double[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `basex-core/src/main/java/org/basex/util/list/IntList.java:446` calls `swap` and `basex-core/src/main/java/org/basex/util/list/IntList.java:630` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–11 lines × 2) basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:197— basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java:197-207 | basex-core/src/main/java/org/basex/query/value/seq/tree/PartialLeafNode.java:43-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 6) basex-core/src/main/java/org/basex/util/list/BoolList.java:56— basex-core/src/main/java/org/basex/util/list/BoolList.java:56-65 | basex-core/src/main/java/org/basex/util/list/DoubleList.java:56-65 | basex-core/src/main/java/org/basex/util/list/FloatList.java:56-65 | basex-core/src/main/java/org/basex/util/list/IntList.java:66-75 | basex-core/src/main/java/org/basex/util/list/LongList.java:56-65 | basex-core/src/main/java/org/basex/util/list/ShortList.java:56-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 all 6 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `basex-core/src/main/java/org/basex/util/list/BoolList.java:56` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `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. Note first that the copies are not typed on the same thing: the declarations holding them bind `elements` to `boolean...` in one and `double...` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8–9 lines × 3) basex-core/src/main/java/org/basex/query/func/fn/FnFilter.java:35— basex-core/src/main/java/org/basex/query/func/fn/FnFilter.java:35-43 | basex-core/src/main/java/org/basex/query/func/fn/FnForEach.java:36-43 | basex-core/src/main/java/org/basex/query/func/fn/FnIndexWhere.java:35-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. 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 (4–7 lines × 3) basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:238— basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:238-241 | basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:244-250 | basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:254-260 — 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 `basex-core/src/main/java/org/basex/util/ft/IndonesianStemmer.java:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17 lines × 2) basex-core/src/main/java/org/basex/query/value/array/TreeArrayBuilder.java:93— basex-core/src/main/java/org/basex/query/value/array/TreeArrayBuilder.java:93-109 | basex-core/src/main/java/org/basex/query/value/seq/tree/TreeSeqBuilder.java:198-214 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (34 lines × 2) basex-core/src/main/java/org/basex/query/func/array/ArrayTail.java:1— basex-core/src/main/java/org/basex/query/func/array/ArrayTail.java:1-34 | basex-core/src/main/java/org/basex/query/func/array/ArrayTrunk.java:1-34 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/func/array/ArrayTail.java` and `basex-core/src/main/java/org/basex/query/func/array/ArrayTrunk.java` as WHOLE FILES: 92% 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 `basex-core/src/main/java/org/basex/query/func/array/ArrayTail.java:1` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) basex-core/src/main/java/org/basex/query/util/hash/ItemObjectMap.java:82— basex-core/src/main/java/org/basex/query/util/hash/ItemObjectMap.java:82-88 | basex-core/src/main/java/org/basex/query/util/hash/QNmMap.java:33-39 | basex-core/src/main/java/org/basex/util/hash/IntObjectMap.java:45-51 | basex-core/src/main/java/org/basex/util/hash/TokenObjectMap.java:45-51 — before extracting anything, compare `basex-core/src/main/java/org/basex/util/hash/IntObjectMap.java` and `basex-core/src/main/java/org/basex/util/hash/TokenObjectMap.java` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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: the declarations holding them bind `key` to `Item` in one and `QNm` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 4) basex-core/src/main/java/org/basex/query/util/hash/ItemObjectMap.java:97— basex-core/src/main/java/org/basex/query/util/hash/ItemObjectMap.java:97-104 | basex-core/src/main/java/org/basex/query/util/hash/QNmMap.java:47-54 | basex-core/src/main/java/org/basex/util/hash/IntObjectMap.java:59-66 | basex-core/src/main/java/org/basex/util/hash/TokenObjectMap.java:59-66 — before extracting anything, compare `basex-core/src/main/java/org/basex/util/hash/IntObjectMap.java` and `basex-core/src/main/java/org/basex/util/hash/TokenObjectMap.java` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `key` to `Item` in one and `QNm` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 3) basex-core/src/main/java/org/basex/query/value/map/XQAtmValueMap.java:82— basex-core/src/main/java/org/basex/query/value/map/XQAtmValueMap.java:82-87 | basex-core/src/main/java/org/basex/query/value/map/XQIntValueMap.java:82-87 | basex-core/src/main/java/org/basex/query/value/map/XQStrValueMap.java:81-86 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/value/map/XQAtmValueMap.java` and `basex-core/src/main/java/org/basex/query/value/map/XQStrValueMap.java` as WHOLE FILES: 83% 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. 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 × 5) REDACTED:56— REDACTED:56-63 | REDACTED:40-47 | basex-core/src/main/java/org/basex/BaseXClient.java:20-27 | basex-core/src/main/java/org/basex/BaseXGUI.java:36-43 | REDACTED:61-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (6 lines × 6) basex-core/src/main/java/org/basex/query/func/fn/FnDayFromDateTime.java:16— basex-core/src/main/java/org/basex/query/func/fn/FnDayFromDateTime.java:16-21 | basex-core/src/main/java/org/basex/query/func/fn/FnHoursFromDateTime.java:16-21 | basex-core/src/main/java/org/basex/query/func/fn/FnMinutesFromDateTime.java:16-21 | basex-core/src/main/java/org/basex/query/func/fn/FnMonthFromDateTime.java:16-21 | basex-core/src/main/java/org/basex/query/func/fn/FnSecondsFromDateTime.java:16-21 | basex-core/src/main/java/org/basex/query/func/fn/FnYearFromDateTime.java:16-21 — before extracting anything, compare `basex-core/src/main/java/org/basex/query/func/fn/FnDayFromDateTime.java` and `basex-core/src/main/java/org/basex/query/func/fn/FnHoursFromDateTime.java` as WHOLE FILES: 90% 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. 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 (4 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (4 members, 50+ identical tokens) basex-examples/src/main/java/org/basex/examples/rest/RESTDelete.java:22— basex-examples/src/main/java/org/basex/examples/rest/RESTDelete.java:22-42 | basex-examples/src/main/java/org/basex/examples/rest/RESTGet.java:22-41 | basex-examples/src/main/java/org/basex/examples/rest/RESTPost.java:22-48 | basex-examples/src/main/java/org/basex/examples/rest/RESTPut.java:23-40 — 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 copies of one member (3 members, 33+ corresponding lines) · ×1
Edited copies of one member (3 members, 33+ corresponding lines) basex-examples/src/main/java/org/basex/examples/local/BindContext.java:19— basex-examples/src/main/java/org/basex/examples/local/BindContext.java:19-51 | basex-examples/src/main/java/org/basex/examples/local/BindVariables.java:19-59 | basex-examples/src/main/java/org/basex/examples/module/FruitsExample.java:19-55 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (11–12 lines × 2) basex-examples/src/main/java/org/basex/examples/xqj/tutorial/Part10.java:36— basex-examples/src/main/java/org/basex/examples/xqj/tutorial/Part10.java:36-46 | basex-examples/src/main/java/org/basex/examples/xqj/tutorial/Part11.java:36-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `basex-examples/src/main/java/org/basex/examples/xqj/tutorial/Part11.java:31` calls `info`, `getStaticContext`, `setStaticContext` and `basex-examples/src/main/java/org/basex/examples/xqj/tutorial/Part10.java:33` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 4) basex-examples/src/main/java/org/basex/examples/rest/RESTDelete.java:49— basex-examples/src/main/java/org/basex/examples/rest/RESTDelete.java:49-57 | basex-examples/src/main/java/org/basex/examples/rest/RESTGet.java:48-56 | basex-examples/src/main/java/org/basex/examples/rest/RESTPost.java:55-63 | basex-examples/src/main/java/org/basex/examples/rest/RESTPut.java:47-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Off the main sequence: basex — basex: abstractness 0.12, instability 0.00, distance 0.88 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
Type Safety — 0 typed · 17 plain JS — the untyped files are basex-api/src/main/javascript/AddExample.mjs, basex-api/src/main/javascript/BaseXClient.mjs, basex-api/src/main/javascript/CreateExample.mjs, basex-api/src/main/javascript/Example.mjs, basex-api/src/main/javascript/QueryBindExample.mjs, basex-api/src/main/javascript/QueryExample.mjs (+11 more).
R10 · Code Duplication· Duplicated block with local edits (11 matched lines × 2 locations) · ×1
Duplicated block with local edits (11 matched lines × 2 locations) basex-api/src/main/javascript/AddExample.mjs:7— basex-api/src/main/javascript/AddExample.mjs:7 · basex-api/src/main/javascript/CreateExample.mjs:7 — the two spans are one implementation copied and then locally edited — 85 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (10 matched lines × 2 locations) · ×1
Duplicated block with local edits (10 matched lines × 2 locations) basex-api/src/main/javascript/QueryBindExample.mjs:7— basex-api/src/main/javascript/QueryBindExample.mjs:7 · basex-api/src/main/javascript/QueryExample.mjs:7 — the two spans are one implementation copied and then locally edited — 71 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (7 matched lines × 2 locations) · ×1
Duplicated block with local edits (7 matched lines × 2 locations) basex-api/src/main/javascript/CreateExample.mjs:11— basex-api/src/main/javascript/CreateExample.mjs:11 · basex-api/src/main/javascript/Example.mjs:14 — the two spans are one implementation copied and then locally edited — 51 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Complex function shortcuts (cyclomatic 66, cognitive 69) basex-modules/dba/src/main/resources/static/js.js:1256— shortcuts has cyclomatic complexity 66 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function workspaceKeys (cyclomatic 25, cognitive 18) basex-modules/dba/src/main/resources/static/workspace.js:885— workspaceKeys has cyclomatic complexity 25 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function closeTab (cyclomatic 15, cognitive 20) basex-modules/dba/src/main/resources/static/workspace.js:265— closeTab has cyclomatic complexity 15 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function logEntries (cyclomatic 15, cognitive 15) basex-modules/dba/src/main/resources/static/logs.js:18— logEntries has cyclomatic complexity 15 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function showActivity (cyclomatic 14, cognitive 39) basex-modules/dba/src/main/resources/static/activity.js:88— showActivity has cyclomatic complexity 14 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 14, cognitive 22) basex-modules/dba/src/main/resources/static/js.js:835— (anonymous) has cyclomatic complexity 14 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function showError (cyclomatic 13, cognitive 14) basex-modules/dba/src/main/resources/static/js.js:981— showError has cyclomatic complexity 13 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function loadCodeMirror (cyclomatic 12, cognitive 24) basex-modules/dba/src/main/resources/static/editor.js:102— loadCodeMirror has cyclomatic complexity 12 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function saveFile (cyclomatic 12, cognitive 15) basex-modules/dba/src/main/resources/static/workspace.js:717— saveFile has cyclomatic complexity 12 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function resize (cyclomatic 11, cognitive 10) basex-modules/dba/src/main/resources/static/js.js:1933— resize has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· basex-modules/dba/src/main/resources/static/js.js · ×1
basex-modules/dba/src/main/resources/static/js.js: 1793 lines of code basex-modules/dba/src/main/resources/static/js.js:1— basex-modules/dba/src/main/resources/static/js.js has 1793 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· basex-modules/dba/src/main/resources/static/workspace.js · ×1
basex-modules/dba/src/main/resources/static/workspace.js: 884 lines of code basex-modules/dba/src/main/resources/static/workspace.js:1— basex-modules/dba/src/main/resources/static/workspace.js has 884 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· basex-modules/dba/src/main/resources/static/databases.js · ×1
basex-modules/dba/src/main/resources/static/databases.js: 422 lines of code basex-modules/dba/src/main/resources/static/databases.js:1— basex-modules/dba/src/main/resources/static/databases.js has 422 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· basex-api/src/main/javascript/BaseXClient.mjs · ×1
basex-api/src/main/javascript/BaseXClient.mjs: 415 lines of code basex-api/src/main/javascript/BaseXClient.mjs:1— basex-api/src/main/javascript/BaseXClient.mjs has 415 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~459 LoC) basex-api/src/main/javascript/BaseXClient.mjs— no import path from any entry point (11 application, 0 tooling, 0 test roots considered), but 5 in-repo import(s) from 5 other file(s) do name it (basex-api/src/main/javascript/AddExample.mjs, basex-api/src/main/javascript/CreateExample.mjs, basex-api/src/main/javascript/Example.mjs and 2 more) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~36 LoC) basex-api/src/main/javascript/AddExample.mjs— no import path from any entry point (11 application, 0 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~32 LoC) basex-api/src/main/javascript/QueryBindExample.mjs— no import path from any entry point (11 application, 0 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~30 LoC) basex-api/src/main/javascript/QueryExample.mjs— no import path from any entry point (11 application, 0 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~28 LoC) basex-api/src/main/javascript/CreateExample.mjs— no import path from any entry point (11 application, 0 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~27 LoC) basex-api/src/main/javascript/Example.mjs— no import path from any entry point (11 application, 0 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
No direct assertions: delete basex-core/src/test/java/org/basex/query/func/fn/FnIdTest.java:25— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: deleteLogs basex-core/src/test/java/org/basex/query/func/AdminModuleTest.java:29— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: logs basex-core/src/test/java/org/basex/query/func/AdminModuleTest.java:36— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: sessions basex-core/src/test/java/org/basex/query/func/AdminModuleTest.java:44— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: writeLog basex-core/src/test/java/org/basex/query/func/AdminModuleTest.java:51— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: close basex-core/src/test/java/org/basex/query/func/ClientModuleTest.java:44— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: connect basex-core/src/test/java/org/basex/query/func/ClientModuleTest.java:55— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: execute basex-core/src/test/java/org/basex/query/func/ClientModuleTest.java:66— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: info basex-core/src/test/java/org/basex/query/func/ClientModuleTest.java:78— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: query basex-core/src/test/java/org/basex/query/func/ClientModuleTest.java:86— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: queryTypes basex-core/src/test/java/org/basex/query/func/ClientModuleTest.java:121— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: add basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:71— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: add2 basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:144— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: alter basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:209— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: alterBackup basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:229— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: attribute basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:257— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: attributeRange basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:274— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: backups basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:289— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: contentType basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:303— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: copy basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:313— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: counts basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:347— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: create2 basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:544— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: create3 basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:559— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: createIndexError basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:637— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: delete basex-core/src/test/java/org/basex/query/func/DbModuleTest.java:713— No conventional assertion call was detected, and 1085 of 1574 tests in `basex` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
Duplicated predicate basex-core/src/main/java/org/basex/query/func/Closure.java:353— `!cc.inlineable(anns, expr, unlimited) || expr.has(Flag.CTX)` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/func/Closure.java, basex-core/src/main/java/org/basex/query/value/item/FuncItem.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 basex-core/src/main/java/org/basex/query/value/item/DTDur.java:73— `!mt.matches() || Strings.endsWith(val, 'P') || Strings.endsWith(val, 'T')` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/value/item/DTDur.java, basex-core/src/main/java/org/basex/query/value/item/Dur.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 basex-core/src/main/java/org/basex/core/cmd/Dir.java:38— `!path.isEmpty() && !Strings.endsWith(path, '/')` appears character-identically in 2 files — basex-core/src/main/java/org/basex/core/cmd/Dir.java, basex-core/src/main/java/org/basex/query/func/db/DbDir.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 basex-core/src/main/java/org/basex/query/expr/gflwor/Trace.java:47— `Flag.NDT.oneOf(flags) || super.has(flags)` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/expr/gflwor/Trace.java, basex-core/src/main/java/org/basex/query/func/java/DynJavaCall.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 basex-core/src/main/java/org/basex/query/expr/IntPos.java:115— `Flag.POS.oneOf(flags) || Flag.CTX.oneOf(flags) || super.has(flags)` appears character-identically in 4 files — basex-core/src/main/java/org/basex/query/expr/IntPos.java, basex-core/src/main/java/org/basex/query/expr/MixedPos.java, basex-core/src/main/java/org/basex/query/expr/Pos.java, basex-core/src/main/java/org/basex/query/expr/SimplePos.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 basex-core/src/main/java/org/basex/query/func/fn/FnLowest.java:96— `REPLICATE.is(input) && ((FnReplicate) input).singleEval(false)` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/func/fn/FnLowest.java, basex-core/src/main/java/org/basex/query/func/fn/FnSort.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 basex-core/src/main/java/org/basex/query/func/fn/FnFoot.java:72— `REPLICATE.is(input) && input.arg(1) instanceof Itr` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/func/fn/FnFoot.java, basex-core/src/main/java/org/basex/query/func/fn/FnHead.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 basex-core/src/main/java/org/basex/query/func/fn/FnCount.java:67— `STRING_TO_CODEPOINTS.is(input) || CHARACTERS.is(input)` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/func/fn/FnCount.java, basex-core/src/main/java/org/basex/query/func/fn/FnEmpty.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 basex-core/src/main/java/org/basex/gui/view/project/ProjectList.java:46— `SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2` appears character-identically in 2 files — basex-core/src/main/java/org/basex/gui/view/project/ProjectList.java, basex-core/src/main/java/org/basex/gui/view/project/ProjectTree.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 basex-core/src/main/java/org/basex/query/func/fn/FnFoldLeft.java:134— `action instanceof FuncItem || action instanceof Closure` appears character-identically in 3 files — basex-core/src/main/java/org/basex/query/func/fn/FnFoldLeft.java, basex-core/src/main/java/org/basex/query/func/fn/FnScan.java, basex-core/src/main/java/org/basex/query/func/fn/FnWhileDo.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 basex-core/src/main/java/org/basex/query/func/fn/FnSubsequence.java:189— `arg(1) instanceof Value && (!defined(2) || arg(2) instanceof Value)` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/func/fn/FnSubsequence.java, basex-core/src/main/java/org/basex/query/func/util/UtilCountWithin.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 basex-core/src/main/java/org/basex/query/func/fn/FnItemsAt.java:177— `args[0].size() == 1 && args[1] instanceof Itr` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/func/fn/FnItemsAt.java, basex-core/src/main/java/org/basex/query/func/fn/FnSubsequence.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 basex-core/src/main/java/org/basex/core/Databases.java:93— `attrs.isDirectory() && !IOFile.isDotFile(name)` appears character-identically in 2 files — basex-core/src/main/java/org/basex/core/Databases.java, basex-core/src/main/java/org/basex/query/util/pkg/EXPathRepo.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 basex-core/src/main/java/org/basex/query/value/item/Itr.java:144— `bd.compareTo(Dec.BD_MINLONG) < 0 || bd.compareTo(Dec.BD_MAXLONG) > 0` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/value/item/Itr.java, basex-core/src/main/java/org/basex/query/value/type/BasicType.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 basex-core/src/main/java/org/basex/query/func/db/DbContentType.java:33— `bin != null && bin.exists() && !bin.isDir()` appears character-identically in 3 files — basex-core/src/main/java/org/basex/query/func/db/DbContentType.java, basex-core/src/main/java/org/basex/query/func/db/DbExists.java, basex-core/src/main/java/org/basex/query/func/db/DbType.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 basex-core/src/main/java/org/basex/core/BaseXException.java:41— `cause != null && cause != this && getCause() == null` appears character-identically in 2 files — basex-core/src/main/java/org/basex/core/BaseXException.java, basex-core/src/main/java/org/basex/query/QueryException.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 basex-core/src/main/java/org/basex/gui/dialog/DialogNew.java:122— `comp == general.browse || comp == general.input` appears character-identically in 2 files — basex-core/src/main/java/org/basex/gui/dialog/DialogNew.java, basex-core/src/main/java/org/basex/gui/dialog/DialogPut.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 basex-core/src/main/java/org/basex/query/value/item/AStr.java:172— `comparable(item) && Token.eq(string(deep.info), item.string(deep.info), deep)` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/value/item/AStr.java, basex-core/src/main/java/org/basex/query/value/item/Atm.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 basex-core/src/main/java/org/basex/query/func/db/DbCreateBackup.java:34— `dataLock(arg(0), false, false, visitor) && super.accept(visitor)` appears character-identically in 4 files — basex-core/src/main/java/org/basex/query/func/db/DbCreateBackup.java, basex-core/src/main/java/org/basex/query/func/ft/FtSearch.java, basex-core/src/main/java/org/basex/query/func/ft/FtTokens.java, basex-core/src/main/java/org/basex/query/func/index/IndexFn.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 basex-core/src/main/java/org/basex/query/func/Closure.java:105— `declType == null || declType.eq(Types.ITEM_ZM)` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/func/Closure.java, basex-core/src/main/java/org/basex/query/var/Var.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 basex-core/src/main/java/org/basex/gui/dialog/DialogDeclaration.java:82— `e.getClickCount() == 2 && SwingUtilities.isLeftMouseButton(e)` appears character-identically in 3 files — basex-core/src/main/java/org/basex/gui/dialog/DialogDeclaration.java, basex-core/src/main/java/org/basex/gui/layout/BaseXList.java, basex-core/src/main/java/org/basex/gui/view/map/MapView.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 basex-core/src/main/java/org/basex/core/users/User.java:328— `elem.hasChildren() || elem.hasAttributes()` appears character-identically in 2 files — basex-core/src/main/java/org/basex/core/users/User.java, basex-core/src/main/java/org/basex/core/users/Users.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 basex-core/src/main/java/org/basex/query/func/file/FileWriteFn.java:46— `encoding == null || encoding == Strings.UTF8` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/func/file/FileWriteFn.java, basex-core/src/main/java/org/basex/util/Token.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 basex-core/src/main/java/org/basex/gui/view/plot/PlotView.java:948— `gui.updating || e.isShiftDown() || !SwingUtilities.isLeftMouseButton(e)` appears character-identically in 2 files — basex-core/src/main/java/org/basex/gui/view/plot/PlotView.java, basex-core/src/main/java/org/basex/gui/view/tree/TreeView.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 basex-core/src/main/java/org/basex/query/value/array/BigArray.java:274— `inLeft >= MIN_DIGIT && inRight >= MIN_DIGIT` appears character-identically in 2 files — basex-core/src/main/java/org/basex/query/value/array/BigArray.java, basex-core/src/main/java/org/basex/query/value/seq/tree/BigSeq.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.
Orphaned file basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.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 basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeBuilder.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 basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.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 basex-core/src/main/java/org/basex/query/util/fingertree/FingerTree.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 basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.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 basex-core/src/main/java/org/basex/query/util/fingertree/SingletonTree.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 basex-core/src/main/java/org/basex/query/util/fingertree/TreeSlice.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 basex-core/src/main/java/org/basex/query/util/fingertree/PartialInnerNode.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 basex-core/src/main/java/org/basex/query/util/fingertree/Node.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 basex-api/src/main/php/BaseXClient/Query.php: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.
Fat interface: RequestState (19 abstract methods) basex-api/src/main/java/org/basex/http/RequestState.java:18— `RequestState` declares 19 abstract methods: `attribute`, `attributes`, `contextPath`, `cookies`, `headerNames`, `headers`, `localAddress`, `method`, `query`, `remoteAddress`, `remoteHostname`, `remotePort`, `scheme`, `serverName`, `serverPort`, `session`, `setAttribute`, `uri`, `url`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 613 significant file(s) lose their only recent owner: basex-core/src/main/java/org/basex/query/QueryError.java, basex-core/src/main/java/org/basex/gui/text/TextEditor.java, basex-core/src/main/java/org/basex/gui/text/SyntaxXQuery.java, basex-core/src/main/java/org/basex/core/Text.java, basex-core/src/main/java/org/basex/gui/text/TextPanel.java, basex-core/src/main/java/org/basex/query/expr/gflwor/GFLWOR.java, basex-core/src/main/java/org/basex/util/Token.java, basex-core/src/main/java/org/basex/query/func/StandardFunc.java (+605 more). Pair on, review, or document these before any departure.
No ADRs found basex-modules/sftp/pom.xml:42— 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 `basex-modules/sftp/pom.xml` makes this repository a deployable product (line 42).
D21 · Naming Consistency· `scanCONTENT` spells `CONTENT` where 19 names in the project spell it `Content` · ×1
`scanCONTENT` spells `CONTENT` where 19 names in the project spell it `Content` basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:183— 19 of 20 names in project basex spell the token `Content` (19 of 20; unit: names in project basex containing `Content`). Peers: BXNode.getTextContent (basex-core/src/main/java/org/basex/api/dom/BXNode.java:182); BXNode.setTextContent (basex-core/src/main/java/org/basex/api/dom/BXNode.java:252); BXText.isElementContentWhitespace (basex-core/src/main/java/org/basex/api/dom/BXText.java:28); XMLScanner.elementContent (basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:1007); ProjectFiles.filterContent (basex-core/src/main/java/org/basex/gui/view/project/ProjectFiles.java:426). Rename to `scanContent`. [rule N6]
D21 · Naming Consistency· `scanELEMENT` spells `ELEMENT` where 29 names in the project spell it `Element` · ×1
`scanELEMENT` spells `ELEMENT` where 29 names in the project spell it `Element` basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:232— 29 of 30 names in project basex spell the token `Element` (29 of 30; unit: names in project basex containing `Element`). Peers: BXAttr.getOwnerElement (basex-core/src/main/java/org/basex/api/dom/BXAttr.java:61); BXDoc.createElement (basex-core/src/main/java/org/basex/api/dom/BXDoc.java:62); BXDoc.createElementNS (basex-core/src/main/java/org/basex/api/dom/BXDoc.java:67); BXDoc.getDocumentElement (basex-core/src/main/java/org/basex/api/dom/BXDoc.java:92); BXDoc.getElementById (basex-core/src/main/java/org/basex/api/dom/BXDoc.java:109). Rename to `scanElement`. [rule N6]
D21 · Naming Consistency· `cDATA` spells `DATA` where 56 names in the project spell it `Data` · ×1
`cDATA` spells `DATA` where 56 names in the project spell it `Data` basex-core/src/main/java/org/basex/build/xml/XMLScanner.java:375— 56 of 57 names in project basex spell the token `Data` (56 of 57; unit: names in project basex containing `Data`). Peers: org.basex.api.dom.BXCData (basex-core/src/main/java/org/basex/api/dom/BXCData.java:12); BXChar.getData (basex-core/src/main/java/org/basex/api/dom/BXChar.java:24); BXChar.substringData (basex-core/src/main/java/org/basex/api/dom/BXChar.java:39); BXChar.appendData (basex-core/src/main/java/org/basex/api/dom/BXChar.java:47); BXChar.deleteData (basex-core/src/main/java/org/basex/api/dom/BXChar.java:52). Rename to `cData`. [rule N6]
D21 · Naming Consistency· `SyntaxXML` spells `XML` where 130 names in the project spell it `Xml` · ×1
`SyntaxXML` spells `XML` where 130 names in the project spell it `Xml` basex-core/src/main/java/org/basex/gui/text/SyntaxXML.java:19— 130 of 131 names in project basex spell the token `Xml` (130 of 131; unit: names in project basex containing `Xml`). Peers: BXDoc.getXmlEncoding (basex-core/src/main/java/org/basex/api/dom/BXDoc.java:139); BXDoc.getXmlStandalone (basex-core/src/main/java/org/basex/api/dom/BXDoc.java:144); BXDoc.getXmlVersion (basex-core/src/main/java/org/basex/api/dom/BXDoc.java:149); BXDoc.setXmlStandalone (basex-core/src/main/java/org/basex/api/dom/BXDoc.java:179); BXDoc.setXmlVersion (basex-core/src/main/java/org/basex/api/dom/BXDoc.java:184). Rename to `SyntaxXml`. [rule N6]
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 10 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: basex-core/src/main/java/org/basex/query/util/fingertree/InnerNode.java, basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeBuilder.java, basex-core/src/main/java/org/basex/query/util/fingertree/FingerTreeIterator.java, basex-core/src/main/java/org/basex/query/util/fingertree/FingerTree.java, basex-core/src/main/java/org/basex/query/value/seq/tree/LeafNode.java, basex-core/src/main/java/org/basex/query/util/fingertree/SingletonTree.java, basex-core/src/main/java/org/basex/query/util/fingertree/TreeSlice.java, basex-core/src/main/java/org/basex/query/util/fingertree/PartialInnerNode.java (and 2 more) (11 orphaned of 925 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 925 of the 2218 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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.
P10 · Library API & versioning· Implementation type on the public API · ×1
Implementation type on the public API basex-core/src/main/java/org/basex/api/dom/BXDomImpl.java:12— 1 public type in `org.basex.api.dom` is marked as implementation by its own namespace, folder or name: `BXDomImpl` (basex-core/src/main/java/org/basex/api/dom/BXDomImpl.java:12, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
Logging is not universal — Only 1/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `basex-api`, `basex-examples`.
No SAST REDACTED:8— 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 2 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.
Nullable reference types not enabled everywhere — 0/7 C# file(s) are in a nullable-enabled context. This repository commits no project file, so nothing sets <Nullable>enable</Nullable> for it: a file is enabled only by its own `#nullable enable`, by a Unity `csc.rsp` with `-nullable:enable` for its assembly, or as a file-based app (`#:` directives) whose `#:property Nullable` does not turn it off. NRTs catch a whole class of null-deref bugs at compile time.
doc comments repeat the names basex-api/src/main/javascript/BaseXClient.mjs:32— 29 of 260 documented parameters and 1 of 378 summaries in `.` only repeat the member or parameter name (e.g. "socket" for `socket`). Delete the restating tags, or add what the name does not say.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 13 file(s) — `basex-core/src/main/java/org/basex/gui/layout/BaseXCombo.java`, `basex-core/src/main/java/org/basex/gui/layout/BaseXSerial.java`, `basex-core/src/main/java/org/basex/gui/view/editor/EditorView.java`, `basex-core/src/main/java/org/basex/query/expr/path/Path.java`, `basex-core/src/main/java/org/basex/query/func/db/DbOptionMap.java`, … (+8 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
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.
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.
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.
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.
Run 01a1e877-b805-7c72-9a1f-9700065357f7 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 28 · Warnings: 1891 · Recommendations: 1190 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 07:45 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.