Public report of kotlin-orm/ktorm, 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 report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 17 November 2026, 22:30 UTC · Survey ID cd_d850387dfcf8452b95b28a41235ae0f8

kotlin-orm/ktorm

Measured 17 November 2026, 22:29 UTC, at code version 1f0fd02

First survey, so nothing to compare with yet
CAI score 62.1out of 100 Adequate
CriticalWeakAdequateStrongExemplary

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

A medium codebase: 23,173 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 0.3 person-years · Weakest lens: Production Readiness, 51.6

Findings by how serious they are

9 critical 106 serious 187 minor

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

This survey was produced by

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

40of 40 dimensions measured by tools.
121of 302 findings point to an exact file and line, so you can open each one in the code. The other 181 concern the repository as a whole, such as missing documentation.
40dimensions across 5 lenses, read from 23,173 lines of product code in 1 project.
Chapters

Executive summary

kotlin-orm/ktorm falls short of our standard for production because we found no automated security scanning of the code, its secrets or its dependencies. It scores 62.1 out of 100 and is rated Adequate, and seven of its nine critical findings are security problems in the build pipeline.

Production Readiness, at 51.6, is the weakest lens and counts most in the score. The best first step is recording design decisions, worth about 6.5 points. Adding a release approval would lift Production Readiness itself, worth about 3.3 points. Raising Production Readiness to 70 would lift the score to about 68.4.

Seven pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Two parts of the code are no longer understood by anyone working on it. Having someone learn the forgotten files and pinning each tool to an exact version would close both risks.

The product code is 23,173 lines, about €38,000 to rebuild.

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

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

If Production Readiness rose from 51.6 to 70, the lowest score rated Strong, the score would rise from 62.1 to about 68.4.

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

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

Top priorities

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

1
Record your significant design decisions.
Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Raises the score by about 6.5 points · Medium effort · Architecture documentation
2
Resolve the 2 Orphaned knowledge finding(s) in Knowledge Freshness — start with BulkInsert.kt, InsertOrUpdate.kt.
Raises the score by about 2.6 points · Low effort · Knowledge Freshness
3
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.
Raises the score by about 3.3 points · Medium effort · Deployment & Rollback

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 €38,000 to build again, about 0.3 person-years of work. Its weakest lens is Production Readiness, at 51.6 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Record your significant design decisions. Of all the actions in this report, it raises the score most for the work it takes: about 6.5 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

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.

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

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 database.CachedRowSetMetadata2 expression.SqlFormatter3 ksp.compiler.formatter4 ksp.spi5 logging6 dsl7 expression.SqlFormatter.Indentation8 ksp.compiler9 ksp.compiler.generator10 ksp.compiler.parser11 ksp.compiler.util12 logging.LogLevel13 schema14 expression15 jackson16 ksp.annotation17 database18 expression.AggregateType19 expression.BinaryExpressionType20 expression.JoinType21 expression.OrderType22 expression.UnaryExpressionType23 expression.WindowFrameBoundType24 expression.WindowFrameUnitType25 expression.WindowFunctionType26 database.Database27 database.JdbcTransactionManager28 database.TransactionIsolation29 entity30 support.oracle31 support.sqlite32 support.sqlserver33 entity.DefaultMethodHandler34 entity.Entity35 global36 jackson.EntityDeserializers37 jackson.EntitySerializers38 schema.ColumnBindingHandler39 support.mysql40 support.postgresql
1 database.CachedRowSetMetadata
2 expression.SqlFormatter
3 ksp.compiler.formatter
4 ksp.spi
5 logging
6 dsl20354
7 expression.SqlFormatter.Indentation3
8 ksp.compiler1
9 ksp.compiler.generator12
10 ksp.compiler.parser4
11 ksp.compiler.util6
12 logging.LogLevel5
13 schema27
14 expression1151
15 jackson3
16 ksp.annotation1
17 database117
18 expression.AggregateType5
19 expression.BinaryExpressionType16
20 expression.JoinType5
21 expression.OrderType2
22 expression.UnaryExpressionType5
23 expression.WindowFrameBoundType5
24 expression.WindowFrameUnitType2
25 expression.WindowFunctionType16
26 database.Database132
27 database.JdbcTransactionManager2
28 database.TransactionIsolation6
29 entity21132
30 support.oracle43
31 support.sqlite310285
32 support.sqlserver253
33 entity.DefaultMethodHandler1
34 entity.Entity212
35 global16541
36 jackson.EntityDeserializers1
37 jackson.EntitySerializers1
38 schema.ColumnBindingHandler1
39 support.mysql693141
40 support.postgresql4253251
Uses a module listed above itPart of a loopThe module itself
1 database.CachedRowSetMetadata2 expression.SqlFormatter3 ksp.compiler.formatter4 ksp.spi5 logging6 dsl7 expression.SqlFormatter.Indentation8 ksp.compiler9 ksp.compiler.generator10 ksp.compiler.parser11 ksp.compiler.util12 logging.LogLevel13 schema14 expression15 jackson16 ksp.annotation17 database18 expression.AggregateType19 expression.BinaryExpressionType20 expression.JoinType21 expression.OrderType22 expression.UnaryExpressionType23 expression.WindowFrameBoundType24 expression.WindowFrameUnitType25 expression.WindowFunctionType26 database.Database27 database.JdbcTransactionManager28 database.TransactionIsolation29 entity30 support.oracle31 support.sqlite32 support.sqlserver33 entity.DefaultMethodHandler34 entity.Entity35 global36 jackson.EntityDeserializers37 jackson.EntitySerializers38 schema.ColumnBindingHandler39 support.mysql40 support.postgresqldatabase.CachedRowSetMetadata1expression.SqlFormatter2ksp.compiler.formatter3ksp.spi4logging5dsl6expression.SqlFormatter.Indentation7ksp.compiler8ksp.compiler.generator9ksp.compiler.parser10ksp.compiler.util11logging.LogLevel12schema13expression14jackson15ksp.annotation16database17expression.AggregateType18expression.BinaryExpressionType19expression.JoinType20expression.OrderType21expression.UnaryExpressionType22expression.WindowFrameBoundType23expression.WindowFrameUnitType24expression.WindowFunctionType25database.Database26database.JdbcTransactionManager27database.TransactionIsolation28entity29support.oracle30support.sqlite31support.sqlserver32entity.DefaultMethodHandler33entity.Entity34global35jackson.EntityDeserializers36jackson.EntitySerializers37schema.ColumnBindingHandler38support.mysql39support.postgresql402035431124652711513111751652552161322621132433102852531212165411116931414253251+17 more modules (most-connected shown)

At a glance — Code Health · 81.9 · Strong ·

At a glance — Architecture · 97.2 · Exemplary ·

At a glance — Maturity · 58.8 · Adequate · gated by M2 ·

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

At a glance — Security · 81.2 · Checked 4 of 10 · gated by D36 ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection7High / Critical
A03:2025 — Software Supply Chain Failures6Medium

Roadmap

Top priorities: 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; 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; Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.

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

Do thisHelpsEffortDimension
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.+6.5 ptsMediumArchitecture documentation
Resolve the 2 Orphaned knowledge finding(s) in Knowledge Freshness — start with BulkInsert.kt, InsertOrUpdate.kt.+2.6 ptsLowKnowledge Freshness
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.+3.3 ptsMediumDeployment & Rollback
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+3.3 ptsMediumRelease Hygiene
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.+2.1 ptsMediumDocumentation (README)
Swallowed exception (empty catch)+1.0 ptsMediumException handling
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+0.3 ptsLowSupply-chain Provenance & Signing
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+0.3 ptsLowSupply-chain Provenance & Signing

File quality

Per-file score 0–10 — a quality signature. Of 35 files carrying findings, judged against the Production bar: 3% slop · 63% mixed · 34% near-clean.

FileScoreBandWorst signal
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt7.0MixedCode Duplication: Members sharing a duplicated core (4 members, 50+ identical tokens)
ktorm-jackson/src/main/kotlin/org/ktorm/jackson/EntityDeserializers.kt7.0MixedCode Duplication: Edited copy of a member (15 corresponding lines)
ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt7.0MixedCode Duplication: Edited copy of a member (22 corresponding lines)
ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt7.1MixedCognitive Complexity: EntityDmlKt.findChangedProperties (cognitive 26)
ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt7.1MixedGod Classes: TooManyMethods: CachedRowSet
ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt7.1MixedCognitive Complexity: MySqlFormatter.visitSelect (cognitive 20)
ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt7.1MixedGod Classes: TooManyMethods: SqlFormatter
ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Functions.kt7.1MixedCode Duplication: Edited copy of a member (12 corresponding lines)
ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt7.2MixedCognitive Complexity: PostgreSqlFormatter.visitSelect (cognitive 20)
ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateSourcesMojo.java7.2MixedCode Duplication: Edited copy of a member (18 corresponding lines)
ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt7.2MixedCode Duplication: Edited copy of a member (15 corresponding lines)
ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt7.2MixedCode Duplication: Duplicated block (15 lines × 2)
ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt7.4MixedCode Duplication: Edited copies of one member (4 members, 25+ corresponding lines)
ktorm-core/src/main/kotlin/org/ktorm/dsl/Dml.kt7.4MixedCode Duplication: Edited copy of a member (19 corresponding lines)
ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/BulkInsert.kt7.4MixedCode Duplication: Edited copies of one member (3 members, 17+ corresponding lines)
ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt7.4MixedCode Duplication: Edited copies of one member (8 members, 11+ corresponding lines)
ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt7.4MixedCode Duplication: Duplicated block (14 lines × 3)
ktorm-core/src/main/kotlin/org/ktorm/entity/EntityExtensions.kt7.8MixedCognitive Complexity: EntityExtensionsKt.hasColumnValue (cognitive 20)
ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt7.8MixedCognitive Complexity: SQLiteFormatter.visitBulkInsert (cognitive 16)

How the grades work

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

Critical — 9

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

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

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

Could not be resolved — 15

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 40 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 — 40 dimensions across the health lenses
D1D2D3D4D6D11D12D13D14D15D17D19D27D28D29D34D35D36D44AX10AX3AX4AX6M1M2M3M4P1P10P3P4P6X12X16X21X23X27X28X3X5

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

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1eba1-8c7f-77cb-ad05-3018cc849060.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT READ here — but this repository measures it: a coverage step in CI (`jacocoTestReport`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.kt), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored.
  • D12 Dependency Hygiene — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Currency was graded against Maven Central, but whether an artifact is DEPRECATED is not: Maven Central publishes no deprecation marker, exactly as rubygems.org does not. Whether one is UNMAINTAINED is not graded either — no registry publishes a maintenance status, and release age does not stand in for one. Two of this dimension's four signals are therefore unread on a Gradle tree, and its score reflects currency alone.
  • D16 Bus Factor — 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. Single-maintainer repository — bus factor is not applicable (33 contributor(s) across 1466 commit(s) sampled, automation and bot accounts excluded). One of them holds 89% of the history; the other 32 hold 0.3% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D20 ADR Quality — 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. The ADR expectation is gated on whether a repository ships a deployable product. Our repo-kind classifier reads .NET project files and the host and package markers of the other ecosystems it knows (a Go `package main`, a Cargo binary, a package.json `bin`, `start` script or application dev server such as Vite or Next, Python console scripts or a Django/WSGI entry point, a Spring Boot / WAR / Gradle application build, a Rack or Rails app, a Composer project, an OTP release or escript, a Dockerfile, a Procfile, a Platform.sh `.platform/routes.yaml`, and the corresponding published-package manifests, including an OTP `*.app.src`, a Drupal module's `*.info` and a Claude Code `.claude-plugin/plugin.json`), and found none here, so we could not tell what kind of repository this is and did not assess its ADR log. This is a gap in our analyzer, not a finding about this repository. Read, stating neither a host nor a published package: `build.gradle.kts`, `buildSrc/build.gradle.kts`.
  • 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's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `(repository root)` (23173 LoC, 373 module-visible types across 22 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
  • 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. `ktorm-core/src/main/kotlin/org/ktorm/dsl/QueryRowSet.kt`, `ktorm-jackson/src/main/kotlin/org/ktorm/jackson/JacksonExtensions.kt`, `ktorm-ksp-annotations/src/main/kotlin/org/ktorm/ksp/annotation/Undefined.kt`, `ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/formatter/CodeFormatter.kt`, `ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt`, … (+2 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.
  • AX1 Captive 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. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and annotated Spring beans in Java/Kotlin only, and this repository uses Spring but declares no bean through a stereotype annotation (@Component, @Service, …) this check reads — its beans are defined elsewhere, such as XML, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'org.ktorm' is imported (ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerDialect.kt:19), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'org.ktorm' is imported (ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerDialect.kt:19), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'org.ktorm' is imported (ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerDialect.kt:19), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'org.ktorm' is imported (ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerDialect.kt:19), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Kotlin is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Kotlin is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.

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.
  • 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.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality 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.
  • 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").
  • 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 Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • 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.

Dimensions

D1 · Cyclomatic Complexity10.0 / 10Exemplary✓ Tool-verified

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

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

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

0 method(s) exceeded the cyclomatic complexity threshold of 15. A further 4 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 SqlTypeMappingsKt.getRegisteringCodeBlock at 27 — they are counted neither in the figure above nor in this dimension's score. 3 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: ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/util/SqlTypeMappings.kt (SqlTypeMappingsKt.getRegisteringCodeBlock at 27), ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt (CachedRowSet.getObject at 24), ktorm-core/src/main/kotlin/org/ktorm/schema/SqlType.kt (SqlType.of at 22). 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.

✓ On the Gold path — maintain.

Detailed fixes: d1_recommendation.md.

D2 · Cognitive Complexity8.6 / 10Strong✓ Tool-verified

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

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

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

10 method(s) exceeded the cognitive complexity threshold of 15; the worst was FileGenerator.generate at 27.

FileGenerator.generate (cognitive 27)ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/generator/FileGenerator.kt:30
EntityDmlKt.findChangedProperties (cognitive 26)ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:307
EntityDmlKt.findChangedColumns (cognitive 25)ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:262
EntityDmlKt.checkUnexpectedDiscarding (cognitive 20)ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:394
EntityExtensionsKt.hasColumnValue (cognitive 20)ktorm-core/src/main/kotlin/org/ktorm/entity/EntityExtensions.kt:33

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

What to do

  1. Bring the 10 bodies over 15 down to 15 or less in Cognitive Complexity — start with FileGenerator.generate (cognitive 27), EntityDmlKt.findChangedProperties (cognitive 26), EntityDmlKt.findChangedColumns (cognitive 25). — 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 10 together lifts Cognitive Complexity from 8.6 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.

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

D3 · God Classes9.6 / 10Stronggated by 5 serious findings✓ Tool-verified

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

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

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

5 god class(es) detected.

TooManyMethods: CachedRowSet · ×2ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:52
ClassTooLong: CachedRowSet · ×2ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:52
FileTooLong: database/CachedRowSet.ktktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt

What to do

  1. Resolve the 2 TooManyMethods finding(s) in God Classes — start with CachedRowSet.kt, SqlFormatter.kt. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 2 ClassTooLong finding(s) in God Classes — start with CachedRowSet.kt, SqlFormatter.kt. — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 1 FileTooLong finding(s) in God Classes — start with CachedRowSet.kt. — One of this dimension's main actionable groups (1 warning-level).

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

D4 · Code Duplication6.5 / 10Adequate✓ Tool-verified

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

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

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

44 duplicated block group(s) detected. 8.7 % of the production lines (2,010 of 23,173) are in a reported copy. A further 40 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (8 lines × 2) · ×6ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt:72
Duplicated block (5 lines × 2) · ×4ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:230
Duplicated block (6 lines × 2) · ×4ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:738
Edited copy of a member (19 corresponding lines) · ×3ktorm-core/src/main/kotlin/org/ktorm/dsl/Dml.kt:91
Edited copy of a member (10 corresponding lines) · ×3ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:190

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

What to do

  1. Resolve the 6 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with InsertOrUpdate.kt (3), MySqlExpressionVisitor.kt, BulkInsert.kt. — One of this dimension's main actionable groups (6 warning-level).
  2. Resolve the 4 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with BulkInsert.kt (2), Query.kt, InsertOrUpdate.kt. — One of this dimension's main actionable groups (4 warning-level).
  3. Resolve the 4 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with Query.kt, MySqlFormatter.kt, BulkInsert.kt. — One of this dimension's main actionable groups (4 warning-level).

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

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

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

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

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

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

0 of 15 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

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

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

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

0 flaky across 1 measured tier(s). Java/Kotlin (repository root, Gradle): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

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

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

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

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

This repository's Gradle dependency graph was RESOLVED BY A BUILD, across every subproject rather than the root alone: 181 artifact(s) resolved, 181 of them gradable against Maven Central, and 169 behind a shipped release. Where a version was requested and a different one won conflict resolution, the RESOLVED version is what is graded — grading the request would recommend an upgrade already applied. Known CVEs in the same graph are a separate question again, reported under D30.

Outdated (compile): org.jetbrains.kotlin:kotlin-stdlib · ×169

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 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 2 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

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

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

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

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

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

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

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

0 deducted task-comment markers across 23173 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.

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

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

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

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

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

2 of 2 documentation facets pass in full. 4 document(s) read across 13 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

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

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

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

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

High interface indirection

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)10.0 / 10Adequategated by 7 critical findings○ Nothing flagged

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

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

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

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

7 finding(s): 0 critical, 7 high, 0 medium, 0 low. 7 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 1 file(s) — `gradlew` (line 177) — 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.

REDACTED

What to do

  1. No action in Static Analysis (SAST) — all 7 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 (7 issue-level, 0 of them charged here).

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

D34 · Knowledge Freshness9.7 / 10Adequategated by 2 critical findings✓ Tool-verified

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

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

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

3 of 95 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt. Counted over 95 of the 153 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×2ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:1
Further orphaned files (smaller)
Orphaned filektorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/Functions.kt:1

What to do

  1. Resolve the 2 Orphaned knowledge finding(s) in Knowledge Freshness — start with BulkInsert.kt, InsertOrUpdate.kt. — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 Orphaned file finding(s) in Knowledge Freshness — start with Functions.kt. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling9.9 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

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

Strongest change-coupling: EntityDeserializers.kt↔EntitySerializers.kt 70%

Change coupling: EntityDeserializers.kt ↔ EntitySerializers.ktktorm-jackson/src/main/kotlin/org/ktorm/jackson/EntityDeserializers.kt:1

What to do

  1. Resolve the 1 Change coupling finding(s) in Change Coupling — start with EntityDeserializers.kt. — 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.

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

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. 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).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — 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.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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

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

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

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

M1 · Documentation (README)6.7 / 10Adequate✓ Tool-verified

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

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

What to do

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

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

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

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
  • No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.

What to do

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

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

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

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

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.

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

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

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

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

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

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

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

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

  • No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:5
  • `buildSrc/build.gradle.kts` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — buildSrc/build.gradle.kts:11

What to do

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

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

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

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

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.
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

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

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

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

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

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

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

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

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

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

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

Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.

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

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

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

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

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

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

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

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×2) — ktorm-core/src/main/kotlin/org/ktorm/database/JdbcTransactionManager.kt:112, ktorm-core/src/main/kotlin/org/ktorm/database/JdbcTransactionManager.kt:116

What to do

  • Swallowed exception (empty catch)
X5 · Nullable reference types9.8 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether Kotlin's null safety is not undermined by not-null assertions — `String` cannot hold null and `String?` must be checked before use in every Kotlin module, and each `!!` is a run-time `NullPointerException` the author has told the compiler cannot happen.

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

Reference — by lens

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

LensScoreRatingImpact
Code Health81.9StrongSolid.
Architecture97.2ExemplaryStrongest area.
Maturity58.8Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness51.6Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security81.2Checked 4 of 10Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Unscored — 2 check(s) recorded observations but carry no score

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

  • P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • X10 Duplicated predicate — 6 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Not assessed: this repository stores data through 'org.ktorm' (ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerDialect.kt:19) but declares no persisted model this check reads (Room/JPA/Spring Data/MongoDB @Entity and Realm classes, Exposed and Ktorm table columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQLDelight files). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
  • C4 Data Retention — Not assessed: this repository stores data through 'org.ktorm' (ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerDialect.kt:19) but declares no persisted model this check reads (Room/JPA/Spring Data/MongoDB @Entity and Realm classes, Exposed and Ktorm table columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQLDelight files). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
  • C5 Data-Subject Rights — Not assessed: this repository stores data through 'org.ktorm' (ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerDialect.kt:19) but declares no persisted model this check reads (Room/JPA/Spring Data/MongoDB @Entity and Realm classes, Exposed and Ktorm table columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQLDelight files). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 70 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • C1 Data Protection — Not assessed: this repository stores data through 'org.ktorm' (ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerDialect.kt:19) but declares no persisted model this check reads (Room/JPA/Spring Data/MongoDB @Entity and Realm classes, Exposed and Ktorm table columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQLDelight files). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~10998 lines of test source are present (.kt) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D20 ADR Quality — Repository kind not determined
  • D21 Naming Consistency — N/A — too few peers to establish a naming convention (4254 declarations, no unit with a dominant convention).
  • D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Kotlin surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .java, .kt, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 7 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 — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).
  • D5 Coupling — Not applicable — this Gradle build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
  • 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 (27 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
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P2 Observability — This repository's JVM source (1 module(s), 133 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service — it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@Benchmark` in a Java, Kotlin or Scala file importing JMH or kotlinx-benchmark, Jetpack Benchmark's `measureRepeated` in a file importing androidx.benchmark, or JMH/kotlinx-benchmark/androidx.benchmark in a pom.xml, Gradle or sbt build, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • 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 C# was loaded; this repository's Java and Kotlin were read, and no request in it can be cancelled by a caller (Ktor, OkHttp's newCall or a URL stream, from a suspend function) — a Java request off Android takes no token: it is cancelled through the handle it returns (Future.cancel, Call.cancel, a Disposable), ambiently (io.grpc.Context) or by interrupting its thread, not through a parameter; a Kotlin request outside a suspend function has no caller's cancellation to honour
  • 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
  • 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
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • 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 — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Kotlin was read, and it logs through none that an assembled message defeats: Android's `Log` and Timber, java.util.logging and log4j-api-kotlin take one finished message (as log4net does in C#), or it makes no call through a named logger at all. Calls made through SLF4J, log4j 2 or kotlin-logging (`LoggerFactory.getLogger`, `KotlinLogging.logger {}`) would be judged.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 9 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×2
  • Orphaned knowledge ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt: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.
  • Orphaned knowledge ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt: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.
Serious — 106 finding(s)
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×6
  • Duplicated block (8 lines × 2) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt:72 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt:72-79 | ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt:87-94 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt:72` 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 (8 lines × 2) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:689 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:689-696 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:693-700 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:689` 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 (8 lines × 2) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:254 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:254-261 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:254-261 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:330 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:330-337 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:330-337 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Functions.kt:125 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Functions.kt:125-132 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/Functions.kt:90-97 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:180 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:180-187 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:180-187 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 71 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 `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×4
  • Duplicated block (5 lines × 2) ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:230 — ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:230-234 | ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:249-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:230` it does not close everything it opens, so those 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) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:245 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:245-249 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:630-634 — both copies are in the same file, so extract the 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 `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:245` 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) ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:245 — ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:245-249 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:631-635 — both copies are in the same file, so extract the 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 `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:245` 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) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:466 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:466-470 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:469-473 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 71 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 `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:466` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×4
  • Duplicated block (6 lines × 2) ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:738 — ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:738-743 | ktorm-core/src/main/kotlin/org/ktorm/entity/EntitySequence.kt:1261-1266 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `ktorm-core/src/main/kotlin/org/ktorm/entity/EntitySequence.kt:1261` it begins part-way through the construct above it, so those 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) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt:82 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt:82-87 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt:39-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:711 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:711-716 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:563-568 — 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) ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateSourcesMojo.java:123 — ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateSourcesMojo.java:123-128 | ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateTestSourcesMojo.java:123-128 — before extracting anything, compare `ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateSourcesMojo.java` and `ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateTestSourcesMojo.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×3
  • Edited copy of a member (19 corresponding lines) ktorm-core/src/main/kotlin/org/ktorm/dsl/Dml.kt:91 — ktorm-core/src/main/kotlin/org/ktorm/dsl/Dml.kt:91-109 | ktorm-core/src/main/kotlin/org/ktorm/dsl/Dml.kt:250-268 — 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) ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/generator/AddFunctionGenerator.kt:153 — ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/generator/AddFunctionGenerator.kt:153-171 | ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/generator/UpdateFunctionGenerator.kt:59-81 — 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) ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt:630 — ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt:630-648 | ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt:650-669 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×3
  • Edited copy of a member (10 corresponding lines) ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:190 — ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:190-200 | ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:205-214 — 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) ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:233 — ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:233-242 | ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:248-257 — 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) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:45 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:45-56 | ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt:45-54 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×3
  • Edited copy of a member (5 corresponding lines) ktorm-core/src/main/kotlin/org/ktorm/entity/EntitySequence.kt:167 — ktorm-core/src/main/kotlin/org/ktorm/entity/EntitySequence.kt:167-171 | ktorm-core/src/main/kotlin/org/ktorm/entity/EntitySequence.kt:180-184 — 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) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:145 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:145-149 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:145-149 — 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) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:444 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:444-448 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:445-449 — 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 · Duplicated block (13 lines × 2) · ×3
  • Duplicated block (13 lines × 2) ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:274 — ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:274-286 | ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:324-336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:348 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:348-360 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:348-360 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 71 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 `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:348` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:123 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:123-135 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt:86-98 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:123` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×3
  • Duplicated block (9 lines × 2) ktorm-core/src/main/kotlin/org/ktorm/dsl/QueryRowSet.kt:64 — ktorm-core/src/main/kotlin/org/ktorm/dsl/QueryRowSet.kt:64-72 | ktorm-core/src/main/kotlin/org/ktorm/dsl/QueryRowSet.kt:118-126 — both copies are in the same file, so extract the 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 `ktorm-core/src/main/kotlin/org/ktorm/dsl/QueryRowSet.kt:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:89 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:89-97 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt:47-55 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Lock.kt:74 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Lock.kt:74-82 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/Lock.kt:75-83 — before extracting anything, compare `ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Lock.kt` and `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/Lock.kt` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×3
  • Duplicated block (7 lines × 2) ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:672 — ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:672-678 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:392-398 — before extracting anything, compare `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:672` 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 (7 lines × 2) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Lock.kt:96 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Lock.kt:96-102 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/Lock.kt:97-103 — before extracting anything, compare `ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Lock.kt` and `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/Lock.kt` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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. 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 `ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Lock.kt:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:716 — ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:716-722 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:569-575 — before extracting anything, compare `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D3 · God Classes · TooManyMethods · ×2
  • TooManyMethods: CachedRowSet ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:52 — TooManyMethods — 209 methods. The bar is 30 methods; this is 179 over it, 6.97× 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: SqlFormatter ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt:34 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.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.
D3 · God Classes · ClassTooLong · ×2
  • ClassTooLong: CachedRowSet ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:52 — ClassTooLong — 883 significant lines (blank, comment-only and punctuation-only lines excluded), 209 methods. The bar is 400 significant lines; this is 483 over it, 2.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SqlFormatter ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt:34 — ClassTooLong — 439 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 39 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×2
  • Edited copy of a member (15 corresponding lines) ktorm-jackson/src/main/kotlin/org/ktorm/jackson/EntityDeserializers.kt:65 — ktorm-jackson/src/main/kotlin/org/ktorm/jackson/EntityDeserializers.kt:65-81 | ktorm-jackson/src/main/kotlin/org/ktorm/jackson/EntitySerializers.kt:64-78 — 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) ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:761 — ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:761-775 | ktorm-core/src/main/kotlin/org/ktorm/entity/EntitySequence.kt:1471-1485 — 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, 12+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 12+ corresponding lines) ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:229 — ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:229-240 | ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:248-259 | ktorm-core/src/main/kotlin/org/ktorm/dsl/Query.kt:266-277 — 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) ktorm-core/src/main/kotlin/org/ktorm/dsl/Dml.kt:48 — ktorm-core/src/main/kotlin/org/ktorm/dsl/Dml.kt:48-59 | ktorm-core/src/main/kotlin/org/ktorm/dsl/Dml.kt:132-143 | ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/InsertOrUpdate.kt:78-89 — 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 copy of a member (13 corresponding lines) · ×2
  • Edited copy of a member (13 corresponding lines) ktorm-jackson/src/main/kotlin/org/ktorm/jackson/JacksonExtensions.kt:83 — ktorm-jackson/src/main/kotlin/org/ktorm/jackson/JacksonExtensions.kt:83-95 | ktorm-jackson/src/main/kotlin/org/ktorm/jackson/JacksonExtensions.kt:97-113 — 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) ktorm-global/src/main/kotlin/org/ktorm/global/Global.kt:144 — ktorm-global/src/main/kotlin/org/ktorm/global/Global.kt:144-159 | ktorm-core/src/main/kotlin/org/ktorm/database/Database.kt:625-637 — 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 (12 corresponding lines) · ×2
  • Edited copy of a member (12 corresponding lines) ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/generator/CopyFunctionGenerator.kt:27 — ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/generator/CopyFunctionGenerator.kt:27-39 | ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/generator/PseudoConstructorFunctionGenerator.kt:33-44 — 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) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Functions.kt:171 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Functions.kt:171-182 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/Functions.kt:130-141 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×2
  • Edited copy of a member (9 corresponding lines) ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:493 — ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:493-501 | ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:618-627 — 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) ktorm-core/src/main/kotlin/org/ktorm/database/Database.kt:593 — ktorm-core/src/main/kotlin/org/ktorm/database/Database.kt:593-601 | ktorm-global/src/main/kotlin/org/ktorm/global/Global.kt:107-118 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×2
  • Edited copy of a member (8 corresponding lines) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Functions.kt:151 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Functions.kt:151-158 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/Functions.kt:113-120 — 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) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Functions.kt:187 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Functions.kt:187-194 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/EarthDistance.kt:148-155 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:368 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:368-382 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:368-382 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 71 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 `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:368` it does not close everything it opens, so those exact lines 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) ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:654 — ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:654-668 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:374-388 — before extracting anything, compare `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:654` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×2
  • Duplicated block (10 lines × 2) ktorm-core/src/main/kotlin/org/ktorm/schema/SqlTypes.kt:513 — ktorm-core/src/main/kotlin/org/ktorm/schema/SqlTypes.kt:513-522 | ktorm-jackson/src/main/kotlin/org/ktorm/jackson/JsonSqlType.kt:84-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `parameter` to `C?` in one and `T?` 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) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/BulkInsert.kt:95 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/BulkInsert.kt:95-104 | ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/BulkInsert.kt:159-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 `ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/BulkInsert.kt:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×2
  • Duplicated block (12 lines × 2) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Functions.kt:213 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/Functions.kt:213-224 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/Functions.kt:165-176 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) ktorm-core/src/main/kotlin/org/ktorm/dsl/Dml.kt:98 — ktorm-core/src/main/kotlin/org/ktorm/dsl/Dml.kt:98-109 | ktorm-core/src/main/kotlin/org/ktorm/dsl/Dml.kt:257-268 — both copies are in the same file, so extract the 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 `ktorm-core/src/main/kotlin/org/ktorm/dsl/Dml.kt:98` 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.
X3 · Exception handling · Swallowed exception (empty catch) · ×2
  • Swallowed exception (empty catch) ktorm-core/src/main/kotlin/org/ktorm/database/JdbcTransactionManager.kt:112 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) ktorm-core/src/main/kotlin/org/ktorm/database/JdbcTransactionManager.kt:116 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D2 · Cognitive Complexity · FileGenerator.generate (cognitive 27) · ×1
  • FileGenerator.generate (cognitive 27) ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/generator/FileGenerator.kt:30 — FileGenerator.generate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 5 (9 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EntityDmlKt.findChangedProperties (cognitive 26) · ×1
  • EntityDmlKt.findChangedProperties (cognitive 26) ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:307 — EntityDmlKt.findChangedProperties has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2 (4 pts), match/switch 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.
D2 · Cognitive Complexity · EntityDmlKt.findChangedColumns (cognitive 25) · ×1
  • EntityDmlKt.findChangedColumns (cognitive 25) ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:262 — EntityDmlKt.findChangedColumns has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 2 (4 pts), match/switch 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.
D2 · Cognitive Complexity · EntityDmlKt.checkUnexpectedDiscarding (cognitive 20) · ×1
  • EntityDmlKt.checkUnexpectedDiscarding (cognitive 20) ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:394 — EntityDmlKt.checkUnexpectedDiscarding has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 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.
D2 · Cognitive Complexity · EntityExtensionsKt.hasColumnValue (cognitive 20) · ×1
  • EntityExtensionsKt.hasColumnValue (cognitive 20) ktorm-core/src/main/kotlin/org/ktorm/entity/EntityExtensions.kt:33 — EntityExtensionsKt.hasColumnValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 11). 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.
D2 · Cognitive Complexity · MySqlFormatter.visitSelect (cognitive 20) · ×1
  • MySqlFormatter.visitSelect (cognitive 20) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt:44 — MySqlFormatter.visitSelect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (4 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.
D2 · Cognitive Complexity · PostgreSqlFormatter.visitSelect (cognitive 20) · ×1
  • PostgreSqlFormatter.visitSelect (cognitive 20) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:36 — PostgreSqlFormatter.visitSelect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (4 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.
D2 · Cognitive Complexity · EntityExtensionsKt.isPrimaryKey (cognitive 19) · ×1
  • EntityExtensionsKt.isPrimaryKey (cognitive 19) ktorm-core/src/main/kotlin/org/ktorm/entity/EntityExtensions.kt:157 — EntityExtensionsKt.isPrimaryKey has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EntityImplementation.handleMethodCall (cognitive 19) · ×1
  • EntityImplementation.handleMethodCall (cognitive 19) ktorm-core/src/main/kotlin/org/ktorm/entity/EntityImplementation.kt:73 — EntityImplementation.handleMethodCall has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteFormatter.visitBulkInsert (cognitive 16) · ×1
  • SQLiteFormatter.visitBulkInsert (cognitive 16) ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt:82 — SQLiteFormatter.visitBulkInsert has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), 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.
D3 · God Classes · FileTooLong · ×1
  • FileTooLong: database/CachedRowSet.kt ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt — FileTooLong — 899 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: CachedRowSet (52-1505). The bar is 500 significant lines; this is 399 over it, 1.80× 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.
D35 · Change Coupling · Change coupling · ×1
  • Change coupling: EntityDeserializers.kt ↔ EntitySerializers.kt ktorm-jackson/src/main/kotlin/org/ktorm/jackson/EntityDeserializers.kt:1 — `ktorm-jackson/src/main/kotlin/org/ktorm/jackson/EntityDeserializers.kt` and `ktorm-jackson/src/main/kotlin/org/ktorm/jackson/EntitySerializers.kt` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `41821a4a` fix skip property names; `56a296c9` support inline class json serialization #253; `b1983de7` keep serialization fields order (at that commit the files were still `ktorm-jackson/src/main/kotlin/me/liuwj/ktorm/jackson/EntityDeserializers.kt` and `ktorm-jackson/src/main/kotlin/me/liuwj/ktorm/jackson/EntitySerializers.kt`) — run `git show` on any of them.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (4 members, 50+ identical tokens) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:641 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:641-674 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:367-395 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:642-678 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:367-398 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt:44 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt:44-80 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:36-73 — 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) ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:262 — ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:262-302 | ktorm-core/src/main/kotlin/org/ktorm/entity/EntityDml.kt:307-353 — 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 (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerFormatter.kt:49 — ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerFormatter.kt:49-79 | ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerFormatter.kt:81-112 — 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 copies of one member (3 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 24+ corresponding lines) ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:72 — ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:72-95 | ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:109-132 | ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:146-169 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 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) ktorm-core/src/main/kotlin/org/ktorm/dsl/QueryRowSet.kt:53 — ktorm-core/src/main/kotlin/org/ktorm/dsl/QueryRowSet.kt:53-80 | ktorm-core/src/main/kotlin/org/ktorm/dsl/QueryRowSet.kt:108-137 — 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 copies of one member (4 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 24+ corresponding lines) ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:183 — ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:183-206 | ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:407-430 | ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:432-455 | ktorm-core/src/main/kotlin/org/ktorm/database/CachedRowSet.kt:457-480 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 25+ corresponding lines) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:61 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:61-85 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:90-114 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteExpressionVisitor.kt:45-72 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteExpressionVisitor.kt:77-104 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×1
  • Edited copy of a member (18 corresponding lines) ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateSourcesMojo.java:103 — ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateSourcesMojo.java:103-120 | ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateTestSourcesMojo.java:103-120 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:516 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:516-537 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:519-542 — 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 (16 corresponding lines) · ×1
  • Edited copy of a member (16 corresponding lines) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/SqlTypes.kt:305 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/SqlTypes.kt:305-321 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/SqlTypes.kt:352-367 — 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 (17 corresponding lines) · ×1
  • Edited copy of a member (17 corresponding lines) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:344 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:344-360 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:344-360 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/BulkInsert.kt:93 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/BulkInsert.kt:93-109 | ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/BulkInsert.kt:157-173 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:256-274 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 11+ corresponding lines) ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:146 — ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:146-156 | ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:175-185 | ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:242-252 | ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:368-378 | ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:396-406 | ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:411-421 | ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt:69-79 | ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt:84-94 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 5+ corresponding lines) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:242 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:242-249 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:627-634 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:329-337 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:505-509 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:242-249 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:628-635 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:329-337 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:508-512 — These 8 members are one piece of code written 8 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 8 times and the copies 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) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/BulkInsert.kt:185 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/BulkInsert.kt:185-196 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:686-696 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:690-700 — 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 (6 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 6+ corresponding lines) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:193 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:193-198 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:534-539 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:253-261 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:193-198 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:535-540 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:253-261 — 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 copy of a member (11 corresponding lines) · ×1
  • Edited copy of a member (11 corresponding lines) ktorm-global/src/main/kotlin/org/ktorm/global/Global.kt:186 — ktorm-global/src/main/kotlin/org/ktorm/global/Global.kt:186-200 | ktorm-core/src/main/kotlin/org/ktorm/database/Database.kt:662-672 — 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 (7 corresponding lines) · ×1
  • Edited copy of a member (7 corresponding lines) ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateSourcesMojo.java:75 — ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateSourcesMojo.java:75-81 | ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateTestSourcesMojo.java:75-81 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt:53 — ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt:53-80 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt:96-123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt:53` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt:55 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt:55-80 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:48-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt:55` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteExpressionVisitor.kt:48 — ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteExpressionVisitor.kt:48-72 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteExpressionVisitor.kt:80-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteExpressionVisitor.kt:48` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:95 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:95-117 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:133-155 — both copies are in the same file, so extract the 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 `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:95` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt:505 — ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt:505-526 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:200-221 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:224-245 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:64 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:64-85 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:93-114 — both copies are in the same file, so extract the 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 `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:64` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:642 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:642-661 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:643-662 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:642` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:652 — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:652-665 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt:373-386 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt:653-666 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt:373-386 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt:102 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt:102-115 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:122-135 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteExpressionVisitor.kt:112-125 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteExpressionVisitor.kt` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt:105 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt:105-116 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:120-131 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt:83-94 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteFormatter.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) ktorm-core/src/main/kotlin/org/ktorm/logging/CommonsLoggerAdapter.kt:42 — ktorm-core/src/main/kotlin/org/ktorm/logging/CommonsLoggerAdapter.kt:42-80 | ktorm-core/src/main/kotlin/org/ktorm/logging/Slf4jLoggerAdapter.kt:41-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:334 — ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:334-343 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:140-149 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:154-163 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:168-177 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt:32 — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt:32-38 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt:32-38 | ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteExpressionVisitor.kt:34-40 — before extracting anything, compare `ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt` and `ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/SQLiteExpressionVisitor.kt` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt:508 — ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt:508-525 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:179-196 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:203-220 | ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt:227-244 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt:508` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×1
  • Duplicated block (14 lines × 2) ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateSourcesMojo.java:104 — ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateSourcesMojo.java:104-117 | ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateTestSourcesMojo.java:104-117 — before extracting anything, compare `ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateSourcesMojo.java` and `ktorm-ksp-compiler-maven-plugin/src/main/java/org/ktorm/ksp/compiler/maven/GenerateTestSourcesMojo.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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.
P12 · CI test-gate honesty · Coverage collected but not gated · ×1
  • Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
Minor — 18 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×6
  • Duplicated predicate ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt:660 — `!builder.doNothing && builder.updateAssignments.isEmpty()` appears character-identically in 4 files — ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/BulkInsert.kt, ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/InsertOrUpdate.kt, ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/BulkInsert.kt, ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/InsertOrUpdate.kt. 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 ktorm-support-oracle/src/main/kotlin/org/ktorm/support/oracle/OracleFormatter.kt:36 — `expr.offset == null && expr.limit == null` appears character-identically in 2 files — ktorm-support-oracle/src/main/kotlin/org/ktorm/support/oracle/OracleFormatter.kt, ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerFormatter.kt. 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 ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt:703 — `expr.type == WindowFrameBoundType.PRECEDING || expr.type == WindowFrameBoundType.FOLLOWING` appears character-identically in 2 files — ktorm-core/src/main/kotlin/org/ktorm/expression/SqlFormatter.kt, ktorm-support-sqlserver/src/main/kotlin/org/ktorm/support/sqlserver/SqlServerFormatter.kt. 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 ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt:338 — `left === expr.left && right === expr.right` appears character-identically in 3 files — ktorm-core/src/main/kotlin/org/ktorm/expression/SqlExpressionVisitor.kt, ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlExpressionVisitor.kt, ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlExpressionVisitor.kt. 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 ktorm-core/src/main/kotlin/org/ktorm/schema/SqlTypes.kt:516 — `pgStatementClass != null && ps.isWrapperFor(pgStatementClass)` appears character-identically in 2 files — ktorm-core/src/main/kotlin/org/ktorm/schema/SqlTypes.kt, ktorm-jackson/src/main/kotlin/org/ktorm/jackson/JsonSqlType.kt. 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 ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt:64 — `table.tableAlias != null && table.tableAlias!!.isNotBlank()` appears character-identically in 2 files — ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt, ktorm-support-postgresql/src/main/kotlin/org/ktorm/support/postgresql/PostgreSqlFormatter.kt. 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.
D27 · Navigability · High interface indirection · ×1
  • High interface indirection — 45 % of calls go through an interface — tracing a call means resolving the implementation each hop. Prefer concrete types where there's a single implementation.
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 1 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/Functions.kt (3 orphaned of 95 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; 95 of the 153 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.
D34 · Knowledge Freshness · Orphaned file · ×1
  • Orphaned file ktorm-support-sqlite/src/main/kotlin/org/ktorm/support/sqlite/Functions.kt: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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation · No architecture diagram/doc · ×1
  • No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:5 — No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation buildSrc/build.gradle.kts:11 — `buildSrc/build.gradle.kts` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
Minor — 169 finding(s)
D12 · Dependency Hygiene · Outdated (compile) · ×169
  • Outdated (compile): org.jetbrains.kotlin:kotlin-stdlib — org.jetbrains.kotlin:kotlin-stdlib 2.0.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-reflect — org.jetbrains.kotlin:kotlin-reflect 2.0.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains:annotations — org.jetbrains:annotations 13.0 → 26.1.0 available.
  • Outdated (compile): org.springframework:spring-jdbc — org.springframework:spring-jdbc 5.0.10.RELEASE → 7.0.10 available.
  • Outdated (compile): org.springframework:spring-beans — org.springframework:spring-beans 5.0.10.RELEASE → 7.0.10 available.
  • Outdated (compile): org.springframework:spring-core — org.springframework:spring-core 5.0.10.RELEASE → 7.0.10 available.
  • Outdated (compile): org.springframework:spring-jcl — org.springframework:spring-jcl 5.0.10.RELEASE → 6.2.19 available.
  • Outdated (compile): org.springframework:spring-tx — org.springframework:spring-tx 5.0.10.RELEASE → 7.0.10 available.
  • Outdated (compile): io.gitlab.arturbosch.detekt:detekt-cli — io.gitlab.arturbosch.detekt:detekt-cli 1.23.6 → 1.23.8 available.
  • Outdated (compile): io.gitlab.arturbosch.detekt:detekt-tooling — io.gitlab.arturbosch.detekt:detekt-tooling 1.23.6 → 1.23.8 available.
  • Outdated (compile): io.gitlab.arturbosch.detekt:detekt-api — io.gitlab.arturbosch.detekt:detekt-api 1.23.6 → 1.23.8 available.
  • Outdated (compile): io.gitlab.arturbosch.detekt:detekt-utils — io.gitlab.arturbosch.detekt:detekt-utils 1.23.6 → 1.23.8 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-stdlib-jdk8 — org.jetbrains.kotlin:kotlin-stdlib-jdk8 1.8.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-stdlib-common — org.jetbrains.kotlin:kotlin-stdlib-common 1.9.23 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-stdlib-jdk7 — org.jetbrains.kotlin:kotlin-stdlib-jdk7 1.8.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-compiler-embeddable — org.jetbrains.kotlin:kotlin-compiler-embeddable 1.9.23 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-script-runtime — org.jetbrains.kotlin:kotlin-script-runtime 1.9.23 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-daemon-embeddable — org.jetbrains.kotlin:kotlin-daemon-embeddable 1.9.23 → 2.4.21 available.
  • Outdated (compile): io.gitlab.arturbosch.detekt:detekt-psi-utils — io.gitlab.arturbosch.detekt:detekt-psi-utils 1.23.6 → 1.23.8 available.
  • Outdated (compile): io.gitlab.arturbosch.detekt:detekt-parser — io.gitlab.arturbosch.detekt:detekt-parser 1.23.6 → 1.23.8 available.
  • Outdated (compile): io.gitlab.arturbosch.detekt:detekt-core — io.gitlab.arturbosch.detekt:detekt-core 1.23.6 → 1.23.8 available.
  • Outdated (compile): org.snakeyaml:snakeyaml-engine — org.snakeyaml:snakeyaml-engine 2.6 → 3.2 available.
  • Outdated (compile): io.gitlab.arturbosch.detekt:detekt-metrics — io.gitlab.arturbosch.detekt:detekt-metrics 1.23.6 → 1.23.8 available.
  • Outdated (compile): io.gitlab.arturbosch.detekt:detekt-report-html — io.gitlab.arturbosch.detekt:detekt-report-html 1.23.6 → 1.23.8 available.
  • Outdated (compile): org.jetbrains.kotlinx:kotlinx-html-jvm — org.jetbrains.kotlinx:kotlinx-html-jvm 0.8.1 → 0.12.0 available.
  • + 144 more in this group — see findings.md.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-549234744e63475da3221537afd62c7a/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-549234744e63475da3221537afd62c7a/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=467" --report-format json --report-path /tmp/watchdog-gitleaks-549234744e63475da3221537afd62c7a/history-2.json --exit-code 0 --source .2artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-549234744e63475da3221537afd62c7a/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .7artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 7 file(s) — `ktorm-core/src/main/kotlin/org/ktorm/dsl/QueryRowSet.kt`, `ktorm-jackson/src/main/kotlin/org/ktorm/jackson/JacksonExtensions.kt`, `ktorm-ksp-annotations/src/main/kotlin/org/ktorm/ksp/annotation/Undefined.kt`, `ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/formatter/CodeFormatter.kt`, `ktorm-support-mysql/src/main/kotlin/org/ktorm/support/mysql/MySqlFormatter.kt`, … (+2 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).0—

Run 01a1eba1-8c7f-77cb-ad05-3018cc849060 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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