Public report of simpledotorg/simple-android, 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, 01:17 UTC · Survey ID cd_0d4f1a72cc5147989ca58361792a4ba0

simpledotorg/simple-android

Measured 17 November 2026, 01:16 UTC, at code version 9a6c7d4

First survey, so nothing to compare with yet
CAI score 66.3out 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: 87,124 lines of product code in 8 projects, tests not counted · Estimated rebuild effort: about 1.8 person-years · Weakest lens: Security and Compliance, 59.9

Findings by how serious they are

44 critical 362 serious 367 minor

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

This survey was produced by

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

53of 53 dimensions measured by tools.
762of 773 findings point to an exact file and line, so you can open each one in the code. The other 11 concern the repository as a whole, such as missing documentation.
53dimensions across 7 lenses, read from 87,124 lines of product code in 8 projects.
Chapters

Executive summary

simpledotorg/simple-android falls short of our standard for production, in part because it has pipeline tools referenced by a changeable name. It scores 66.3 out of 100 and is rated Adequate, and all 44 of its critical findings are security problems in the build pipeline.

Security and Compliance, at 59.9, is the weakest lens and counts most in the score. The best first step is protecting the secrets in build commands, worth about 4.0 points. Restricting the build's access tokens comes next, worth about 3.9 points. Raising Security and Compliance to 70 would lift the score to about 70.1.

Thirty-six pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Seven secrets can leak from the build pipeline, and one pipeline step puts outside input straight into a shell command, so an attacker can run commands in the build pipeline. Pinning each tool to an exact version, limiting each secret to its own step and passing outside input through environment variables would close these risks.

The product code is 87,124 lines, about €260,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.
Security and Compliance 59.9 · counts for 46%Domain Modelling 66.2 · counts for 25%Production Readiness 69.7 · counts for 14%Code Health 79.9 · counts for 8%Maturity 80.6 · counts for 4%Performance 88.6 · counts for 2%Architecture 91.3 · counts for 1%

If Security and Compliance rose from 59.9 to 70, the lowest score rated Strong, the score would rise from 66.3 to about 70.1.

Code composition: what the lines of code are
Product code 54%Tests 46%
Rebuild cost: about €260,000 · Estimate
Cost to rebuild€88,000 to €440,000, for 1,463 to 4,641 hours of work, about 1.8 person-years for 1 to 4 engineers
Difficulty of the problemHigh, 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 66. 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: 87,124 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2), REDACTED (2).
Raises the score by about 4.0 points · Low effort · Static Analysis (SAST)
2
Resolve the 6 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED.
Raises the score by about 3.9 points · Low effort · Supply-chain Provenance & Signing
3
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.
Raises the score by about 2.3 points · Low effort · Static Analysis (SAST)

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 €260,000 to build again, about 1.8 person-years of work. Its weakest lens is Security and Compliance, at 59.9 (Adequate). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Resolve the 6 REDACTED finding(s) in Static Analysis (SAST). Of all the actions in this report, it raises the score most for the work it takes: about 4.0 points for low effort, because it clears the 6 Static Analysis (SAST) findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch :app :app :common-ui :common-ui :app->:common-ui :mobius-base :mobius-base :app->:mobius-base :simple-platform :simple-platform :app->:simple-platform :simple-visuals :simple-visuals :app->:simple-visuals :lint :lint :mobius-base->:simple-platform :mobius-migration :mobius-migration codehealth-iso-6d6c7ba8c7894fff93b58975a17db053 codehealth-iso-6d6c7ba8c7894fff93b58975a17db053

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.

955 modules, with 2660 dependencies between them. 5 loops run through 437 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 915 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 mobius2 navigation.v2.ScreenKey3 patient.businessid4 util.room5 util.scheduler6 medicalhistory7 navigation.v28 navigation.v2.fragments9 widgets10 drugs.search11 drugs12 user13 registration.phone14 sync15 home.overdue16 overdue17 bloodsugar.entry18 bloodsugar19 contactpatient20 patient21 facility22 remoteconfig23 feature24 registerorlogin25 util26 instantsearch27 scanid28 storage29 appconfig30 main31 bp32 di33 editpatient34 home.overdue.search35 newentry36 org.simple.clinic37 bp.entry38 summary39 scheduleappointment40 summary.teleconsultation.contactdoctor
1 mobius
2 navigation.v2.ScreenKey
3 patient.businessid
4 util.room
5 util.scheduler
6 medicalhistory1211
7 navigation.v21
8 navigation.v2.fragments8
9 widgets131
10 drugs.search11112111111
11 drugs21121122211
12 user11111111112
13 registration.phone212118111
14 sync3114212231311
15 home.overdue2121114441271
16 overdue612121
17 bloodsugar.entry21112112011151
18 bloodsugar111121311
19 contactpatient212111219164171
20 patient93111111111421
21 facility531
22 remoteconfig11
23 feature2
24 registerorlogin11211
25 util1211
26 instantsearch2713121310112
27 scanid2912121112
28 storage31
29 appconfig11
30 main1181521122
31 bp11121321
32 di122415
33 editpatient210141113191232
34 home.overdue.search2121242111151
35 newentry2411112161121
36 org.simple.clinic2211254212123
37 bp.entry11311111581
38 summary451114121221321113326221
39 scheduleappointment3121111291311
40 summary.teleconsultation.contactdoctor1113111111116
Uses a module listed above itPart of a loopThe module itself
1 mobius2 navigation.v2.ScreenKey3 patient.businessid4 util.room5 util.scheduler6 medicalhistory7 navigation.v28 navigation.v2.fragments9 widgets10 drugs.search11 drugs12 user13 registration.phone14 sync15 home.overdue16 overdue17 bloodsugar.entry18 bloodsugar19 contactpatient20 patient21 facility22 remoteconfig23 feature24 registerorlogin25 util26 instantsearch27 scanid28 storage29 appconfig30 main31 bp32 di33 editpatient34 home.overdue.search35 newentry36 org.simple.clinic37 bp.entry38 summary39 scheduleappointment40 summary.teleconsultation.contactdoctormobius1navigation.v2.ScreenKey2patient.businessid3util.room4util.scheduler5medicalhistory6navigation.v27navigation.v2.fragments8widgets9drugs.search10drugs11user12registration.phone13sync14home.overdue15overdue16bloodsugar.entry17bloodsugar18contactpatient19patient20facility21remoteconfig22feature23registerorlogin24util25instantsearch26scanid27storage28appconfig29main30bp31di32editpatient33home.overdue.search34newentry35org.simple.clinic36bp.entry37summary38scheduleappointment39summary.teleconsultation.contactdoctor401211181311111211111121121122211111111111122121181113114212231311212111444127161212121112112011151111121311212111219164171931111111114215311121121112112713121310112291212111231111181521122111213211224152101411131912322121242111151241111216112122112542121231131111158145111412122132111332622131211112913111113111111116+915 more modules (most-connected shown)

At a glance — Code Health · 79.9 · Strong ·

At a glance — Architecture · 91.3 · Exemplary ·

At a glance — Maturity · 80.6 · Adequate · gated by D34 ·

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

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

At a glance — Domain Modelling · 66.2 · Adequate · gated by DM4 ·

At a glance — Performance · 88.6 · Strong ·

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 — Injection46High / Critical
A03:2025 — Software Supply Chain Failures10Medium

Roadmap

Top priorities: Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2), REDACTED (2); Resolve the 6 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED; Move business rules onto the aggregates/entities they govern so invariants are enforced at the source, not in anemic services.

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

Do thisHelpsEffortDimension
Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2), REDACTED (2).+4.0 ptsLowStatic Analysis (SAST)
Resolve the 6 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED.+3.9 ptsLowSupply-chain Provenance & Signing
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+2.3 ptsLowStatic Analysis (SAST)
Move business rules onto the aggregates/entities they govern so invariants are enforced at the source, not in anemic services.+2.6 ptsMediumRich vs anemic model
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.+1.8 ptsMediumSecurity & performance tooling
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+0.9 ptsLowSupply-chain Provenance & Signing
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+0.9 ptsLowSupply-chain Provenance & Signing
Give each aggregate one way in that can refuse — a guarded constructor, value-object parameters that validate themselves, or a private constructor behind a factory that returns a failure.+1.6 ptsMediumConstructible invalid state

File quality

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

FileScoreBandWorst signal
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt5.5MixedCyclomatic Complexity: PatientSummaryUpdate.dataForHandlingBackLoaded (cyclomatic 24)
app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt6.0MixedExplicit Debt: FixmeComment
app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt6.0MixedExplicit Debt: TodoComment
app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistoryRepository.kt6.0MixedExplicit Debt: TodoComment
app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummaryView.kt6.3MixedCode Duplication: Edited copy of a member (32 corresponding lines)
app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffectHandler.kt6.3MixedCode Duplication: Edited copy of a member (19 corresponding lines)
app/src/main/java/org/simple/clinic/deeplink/DeepLinkActivity.kt6.3MixedCode Duplication: Edited copy of a member (6 corresponding lines)
app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt6.5MixedGod Classes: TooManyMethods: EditPatientScreen
app/src/main/java/org/simple/clinic/consent/onboarding/OnboardingConsentScreen.kt6.7MixedExplicit Debt: TodoComment
app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorView.kt6.7MixedExplicit Debt: TodoComment
app/src/main/java/org/simple/clinic/medicalhistory/sync/MedicalHistoryPayload.kt6.7MixedExplicit Debt: TodoComment
app/src/test/java/org/simple/clinic/newentry/PatientEntryScreenLogicTest.kt6.9MixedExplicit Debt: TodoComment
app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntrySheet.kt7.0MixedGod Classes: TooManyMethods: BloodPressureEntrySheet
app/src/main/java/org/simple/clinic/AppDatabase.kt7.0MixedGod Classes: TooManyMethods: AppDatabase

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

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

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

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

Could not be resolved — 17

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

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 53 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 — 53 dimensions across the health lenses
D1D2D3D4D5D6D7D13D14D15D16D17D19D20D21D26D28D29D34D35D36D44AX10AX3AX5AX6C1C4DM10DM11DM4DM5DM7DM9M1M2M3M4P1P3P4P6PF1PF3X1X12X16X21X25X27X3X30X5

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, 762 of 773 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 01a1e713-a491-7906-b73d-30622513bbba.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.kt) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.kt) and this repository declares a JVM test suite (repository root, Gradle), but it was not re-run: the analyzer environment could not run it. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — a Gradle build resolved 524 artifact(s) across its subprojects (148 behind a shipped release, reported), but the currency signal was not established over the whole graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: it declares a published package (simple-visuals/build.gradle.kts), but no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • 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. `app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskCalculationSheet.kt`, `app/src/main/java/org/simple/clinic/drugs/selection/custom/drugfrequency/country/DrugFrequencyLabel.kt`, `app/src/main/java/org/simple/clinic/monthlyreports/form/compose/QuestionnaireInputField.kt`, `app/src/main/java/org/simple/clinic/patient/onlinelookup/api/SecondsDuration.kt`, `app/src/main/java/org/simple/clinic/scanid/IndiaNHIDDateOfBirth.kt`, … (+4 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.
  • AXR1 Runtime accessibility — 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. Boot via AndroidApp (app). the Android app did not build — `./gradlew :app:assembleDebug` exited 1: com.github.requery:sqlite-android:3.49.0. > Could not get resource 'https://jitpack.io/com/github/requery/sqlite-android/3.49.0/sqlite-android-3.49.0.pom'. > Could not GET 'https…; runtime evidence skipped (launch chosen because app/build.gradle.kts applies the Android application plugin and gradlew builds it).
  • 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.
  • DM8 Value-object opportunities — 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 finds primitive parameters that travel together through several signatures of the domain (a missing value object). Its deterministic rule has not yet shown 95 % precision on adjudicated rows, so the clumps it finds are counted here and not published as findings, and the card carries no score. That is a limit of the analyzer, not a finding about your code.
  • DM9 Scattered domain decisions — 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. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
  • DM9 Scattered domain decisions — 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. Some of this repository's production types come from a frontend that does not bind comparison operands to the members they read, which arm one needs, and those types were not walked for this dimension. The counts above speak for the languages that declare it.
  • ED5 Idempotency — 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 decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
  • 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 no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java was found, and this repository's Kotlin 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 no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's Kotlin 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.
  • M4 Documentation accuracy — 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. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • 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.
  • X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, 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.
  • X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • 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.
  • C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
  • DM4 Rich vs anemic model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • M4 Documentation accuracy: 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 Complexity9.4 / 10Stronggated by 2 serious findings✓ 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 9.4 / 10 · rule-coverage 100% · ceiling Prevented

2 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was PatientSummaryUpdate.dataForHandlingBackLoaded at 24. A further 8 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 PatientSummaryUpdate.update at 44 — they are counted neither in the figure above nor in this dimension's score. 7 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: app/src/main/java/org/simple/clinic/summary/PatientSummaryViewEffectHandler.kt (PatientSummaryViewEffectHandler.handle at 27), app/src/main/java/org/simple/clinic/editpatient/EditPatientUpdate.kt (EditPatientUpdate.update at 22), app/src/main/java/org/simple/clinic/newentry/PatientEntryUpdate.kt (PatientEntryUpdate.update at 19), app/src/main/java/org/simple/clinic/newentry/PatientEntryViewEffectHandler.kt (PatientEntryViewEffectHandler.showValidationErrors at 19), app/src/main/java/org/simple/clinic/contactpatient/ContactPatientUpdate.kt (ContactPatientUpdate.update at 18), and 2 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

PatientSummaryUpdate.dataForHandlingBackLoaded (cyclomatic 24)app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:620
PatientSummaryUpdate.dataForHandlingDoneClickLoaded (cyclomatic 21)app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:570

What to do

  1. Bring the 2 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with PatientSummaryUpdate.dataForHandlingBackLoaded (cyclomatic 24), PatientSummaryUpdate.dataForHandlingDoneClickLoaded (cyclomatic 21). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 9.4 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.

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

D2 · Cognitive Complexity10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 method(s) exceeded the cognitive complexity threshold of 15.

✓ On the Gold path — maintain.

Detailed fixes: d2_recommendation.md.

D3 · God Classes8.8 / 10Strong✓ Tool-verified

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

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

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

32 god class(es) detected.

TooManyMethods: PatientSummaryScreen · ×18app/src/main/java/org/simple/clinic/summary/PatientSummaryScreen.kt:95
ClassTooLong: PatientRepository · ×6app/src/main/java/org/simple/clinic/patient/PatientRepository.kt:47
FileTooLong: patient/PatientRepository.kt · ×6app/src/main/java/org/simple/clinic/patient/PatientRepository.kt
MethodTooLong: SimpleThemeKt.parseSimpleTypography · ×2common-ui/src/main/java/org/simple/clinic/common/ui/theme/SimpleTheme.kt:133

What to do

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

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

D4 · Code Duplication7.9 / 10Strong✓ 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 7.9 / 10 · rule-coverage 100% · ceiling Verified

68 duplicated block group(s) detected. 5.3 % of the production lines (4,620 of 87,124) are in a reported copy. A further 116 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Edited copy of a member (9 corresponding lines) · ×14app/src/main/java/org/simple/clinic/drugs/selection/custom/drugfrequency/country/CommonDrugFrequencyProvider.kt:12
Edited copy of a member (8 corresponding lines) · ×12app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinEffectHandler.kt:35
Duplicated block (8 lines × 2) · ×8app/src/main/java/org/simple/clinic/medicalhistory/ui/HistoryContainer.kt:30
Edited copy of a member (10 corresponding lines) · ×7app/src/main/java/org/simple/clinic/editpatient/EditPatientEffectHandler.kt:61
Edited copy of a member (13 corresponding lines) · ×6app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistory.kt:100

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

What to do

  1. Resolve the 14 Edited copy of a member (9 corresponding lines) finding(s) in Code Duplication — start with CommonDrugFrequencyProvider.kt, NewMedicalHistoryEffectHandler.kt, OverdueDownloadWorker.kt. — One of this dimension's main actionable groups (14 warning-level).
  2. Resolve the 12 Edited copy of a member (8 corresponding lines) finding(s) in Code Duplication — start with ForgotPinConfirmPinEffectHandler.kt, BloodSugarHistoryScreenEffectHandler.kt, BloodSugarHistoryScreenUpdate.kt. — One of this dimension's main actionable groups (12 warning-level).
  3. Resolve the 8 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with HistoryContainer.kt, EditPatientEffectHandler.kt, ForgotPinConfirmPinEffectHandler.kt. — One of this dimension's main actionable groups (8 warning-level).

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

D5 · Coupling8.0 / 10Strong✓ Tool-verified

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

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

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

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

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

Off the main sequence: :simple-visuals · ×2
Off the main sequence: :common-ui

What to do

  1. Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).

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

D6 · Cohesion (LCOM4)9.1 / 10Stronggated by 24 serious findings✓ 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 9.1 / 10 · rule-coverage 100% · ceiling Verified

24 of 328 classes have LCOM4 above 3.

Low cohesion: BloodPressureEntrySheet (LCOM4 9) · ×24app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntrySheet.kt:59

What to do

  1. Resolve the 24 Low cohesion finding(s) in Cohesion (LCOM4) — start with BloodPressureEntrySheet.kt, DeepLinkActivity.kt, TeleconsultDoctorInfoView.kt. — One of this dimension's main actionable groups (24 warning-level).

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

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

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

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Detailed fixes: d7_recommendation.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. 1 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.

✓ 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 29 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 9 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. 10 further coordinate(s) are declared with no version at the declaration site — inherited from a parent POM, a BOM or an unresolved Gradle version reference — and are NOT graded: this verdict covers what the checkout pins, not the full transitive graph. 1 of them resolve to no licence at all on Central, even through their parent POMs; that is missing data, not a violation, and none of them is charged. A further 26 coordinate(s) are not published to Maven Central — another repository (Google's Maven hosts androidx), a SNAPSHOT, or a private artifact — so their licences are not readable from here and they are outside this verdict.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

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

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

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

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

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

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

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

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

10 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt. Counted over 335 of the 2004 production source files in this repository: 1615 are under the ~2,400-byte size floor this dimension measures over, and the remaining 54 have no attributable history left to measure.

Off-boarding risk: anonymized user #1

✓ On the Gold path — maintain.

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

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

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

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

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

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

TodoComment · ×37app/src/test/java/org/simple/clinic/user/resetpin/ResetUserPinTest.kt:169
FixmeComment · ×5app/src/test/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinScreenLogicTest.kt:61

What to do

  1. Resolve the 37 TodoComment finding(s) in Explicit Debt — start with PatientEntryScreenLogicTest.kt (3), MedicalHistoryRepository.kt (3), ResetUserPinTest.kt (2). — One of this dimension's main actionable groups (37 warning-level).
  2. Resolve the 5 FixmeComment finding(s) in Explicit Debt — start with UserSession.kt (2), PatientEntryScreen.kt (2), ForgotPinConfirmPinScreenLogicTest.kt. — One of this dimension's main actionable groups (5 warning-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality8.5 / 10Strong✓ Tool-verified

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

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

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

2 of 13 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.

ADR has no Decision section · ×2doc/arch/002-bottom-sheets.md:1detected by adr-integrity

What to do

  1. Resolve the 2 ADR has no Decision section finding(s) in ADR Quality — start with 002-bottom-sheets.md, 011-screen-navigation-v2.md. — One of this dimension's main actionable groups (2 recommendation-level).

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

D21 · Naming Consistency8.3 / 10Strong✓ Tool-verified

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

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

24 naming inconsistencies among 1377 declarations measured against a convention their peers follow.

`patientUUID` spells `UUID` where 618 names in the project spell it `Uuid` · ×6app/src/main/java/org/simple/clinic/overdue/Appointment.kt:348
`appointmentUUID` spells `UUID` where 618 names in the project spell it `Uuid` · ×3app/src/main/java/org/simple/clinic/overdue/Appointment.kt:233
`calculateCvdRisk` spells `Cvd` where 37 names in the project spell it `CVD` · ×2app/src/main/java/org/simple/clinic/cvdrisk/calculator/LabBasedCVDRiskCalculator.kt:18
`setupCallResultOutcomeUI` spells `UI` where 260 names in the project spell it `Ui`app/src/main/java/org/simple/clinic/contactpatient/ContactPatientUiRenderer.kt:53
`setUpUIForCreatingDrugEntry` spells `UI` where 260 names in the project spell it `Ui`app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryUiRenderer.kt:59

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

What to do

  1. Resolve the 6 `patientUUID` spells `UUID` where 618 names in the project spell it… finding(s) in Naming Consistency — start with CholesterolEntryModel.kt (2), Appointment.kt, PatientSummaryEffect.kt. — One of this dimension's main actionable groups (6 recommendation-level).
  2. Resolve the 3 `appointmentUUID` spells `UUID` where 618 names in the project spell it… finding(s) in Naming Consistency — start with Appointment.kt (2), CallResult.kt. — One of this dimension's main actionable groups (3 recommendation-level).
  3. Resolve the 2 `calculateCvdRisk` spells `Cvd` where 37 names in the project spell it… finding(s) in Naming Consistency — start with LabBasedCVDRiskCalculator.kt, NonLabBasedCVDRiskCalculator.kt. — One of this dimension's main actionable groups (2 recommendation-level).

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

D26 · Project Cohesion7.5 / 10Strong✓ Tool-verified

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

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

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

1 of 8 build units (Gradle) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesionapp/build.gradle.kts:1

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with build.gradle.kts. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_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)2.3 / 10Critical✓ Tool-verified

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

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

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

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

46 finding(s): 0 critical, 44 high, 2 medium, 0 low. 36 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 3 file(s) — `gradlew` (line 74, line 178), `newbranch.sh` (line 21), `sms-signature` (line 3, line 4) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 3 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (6 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. No action in Static Analysis (SAST) — all 36 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 (36 issue-level, 0 of them charged here).

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

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

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

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

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

314 of 389 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt. Counted over 389 of the 2004 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×311app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.kt:1
Most significant orphaned file · ×3app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:1
Concentrated knowledge decay

What to do

  1. Resolve the 311 Orphaned file finding(s) in Knowledge Freshness — start with BloodSugarEntrySheet.kt, Patient.kt, ContactPatientBottomSheet.kt. — One of this dimension's main actionable groups (311 recommendation-level).
  2. Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with EditPatientScreen.kt, PatientRepository.kt, PatientEntryScreen.kt. — One of this dimension's main actionable groups (3 recommendation-level).
  3. Resolve the 1 Concentrated knowledge decay finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling9.9 / 10Stronggated by 9 serious findings✓ 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: AppDatabase.kt↔RoomMigrationsModule.kt 98%; MedicalHistoryPayload.kt↔MedicalHistorySync.kt 75%; PatientSummaryEffectHandler.kt↔PatientSummaryUiActions.kt 74%

Change coupling: AppDatabase.kt ↔ RoomMigrationsModule.kt · ×7app/src/main/java/org/simple/clinic/AppDatabase.kt:1
Change-coupling hub: LookupPatientOnline.kt → AppDatabase.kt, MedicalHistoryRepository.kt, RoomMigrationsModule.kt · ×2app/src/main/java/org/simple/clinic/patient/onlinelookup/api/LookupPatientOnline.kt

What to do

  1. Resolve the 7 Change coupling finding(s) in Change Coupling — start with PatientSummaryEffect.kt (2), AppDatabase.kt, MedicalHistoryPayload.kt. — One of this dimension's main actionable groups (7 warning-level).
  2. Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with LookupPatientOnline.kt, PatientSummaryUpdate.kt. — One of this dimension's main actionable groups (2 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

What to do

  1. Resolve the 6 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (6 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — 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 8 platform declaration(s) and 55 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 composition9.5 / 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.

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

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

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

AX6 · Interface segregation9.9 / 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.

  • `AppDatabase` declares 30 abstract methods: `patientDao`, `addressDao`, `phoneNumberDao`, `patientSearchDao`, `bloodPressureDao`, `prescriptionDao`, `facilityDao`, `userDao`, `appointmentDao`, `overdueAppointmentDao`, `medicalHistoryDao`, `ongoingLoginEntryDao`, `protocolDao`, `protocolDrugDao`, `recentPatientDao`, `businessIdDao`, `missingPhoneReminderDao`, `bloodSugarDao`, `textRecordDao`, `teleconsultFacilityInfoDao`, `teleconsultMedicalOfficersDao`, `teleconsultFacilityWithMedicalOfficersDao`, `teleconsultRecordDao`, `drugDao`, `callResultDao`, `questionnaireDao`, `questionnaireResponseDao`, `patientAttributeDao`, `cvdRiskDao`, `returnScoreDao`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/AppDatabase.kt:156
  • `RoomDao` declares 22 abstract methods: `save`, `latestMeasurements`, `latestMeasurementsImmediate`, `allBloodSugars`, `allBloodSugarsImmediate`, `allBloodSugarsPagingSource`, `withSyncStatus`, `recordsWithSyncStatusBatched`, `updateSyncStatus`, `updateSyncStatusForIdsRaw`, `getOne`, `recordIdsWithSyncStatus`, `count`, `countWithStatus`, `recordedBloodSugarsCountForPatient`, `recordedBloodSugarsCountForPatientImmediate`, `haveBloodSugarsForPatientChangedSince`, `clear`, `purgeDeleted`, `getAllBloodSugarMeasurements`, `deleteWithoutLinkedPatient`, `purgeBloodSugarMeasurementWhenPatientIsNull`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:77
  • `BloodSugarEntryUi` declares 16 abstract methods: `showRemoveButton`, `hideRemoveButton`, `showEntryTitle`, `showEditTitle`, `showProgress`, `hideProgress`, `setBloodSugarUnitPreferenceLabelToMmol`, `setBloodSugarUnitPreferenceLabelToMg`, `showBloodSugarUnitPreferenceButton`, `hideBloodSugarUnitPreferenceButton`, `showBloodSugarUnitPreferenceLabel`, `hideBloodSugarUnitPreferenceLabel`, `decimalOrNumericBloodSugarInputType`, `numericBloodSugarInputType`, `setLabelForHbA1c`, `setLabelForUnknown`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUi.kt:8
  • `BloodSugarEntryUiActions` declares 16 abstract methods: `setBloodSugarReading`, `hideBloodSugarErrorMessage`, `hideDateErrorMessage`, `dismiss`, `showDateEntryScreen`, `setBloodSugarSavedResultAndFinish`, `showConfirmRemoveBloodSugarDialog`, `showBloodSugarUnitSelectionDialog`, `showBloodSugarEmptyError`, `showBloodSugarHighError`, `showBloodSugarLowError`, `showInvalidDateError`, `showDateIsInFutureError`, `showBloodSugarEntryScreen`, `showBloodSugarDate`, `setDateOnInputFields`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUiActions.kt:8
  • `RoomDao` declares 27 abstract methods: `withSyncStatus`, `withSyncStatusBatched`, `updateSyncStatus`, `updateSyncStatusForIdsRaw`, `save`, `getOne`, `recordIdsWithStatus`, `bloodPressure`, `bloodPressureImmediate`, `count`, `countWithStatus`, `recordedBloodPressureCountForPatientImmediate`, `recordedBloodPressureCountForPatient`, `newestMeasurementsForPatient`, `newestMeasurementsForPatientImmediate`, `clearData`, `patientToFacilityIds`, `haveBpsForPatientChangedSince`, `allBloodPressures`, `hasBPRecordedToday`, `allBloodPressuresRecordedSinceImmediate`, `allBloodPressuresPagingSource`, `purgeDeleted`, `getAllBloodPressureMeasurements`, `deleteWithoutLinkedPatient`, `purgeBloodPressureMeasurementWhenPatientIsNull`, `isNewestBpEntryHigh`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/bp/BloodPressureMeasurement.kt:85
  • `BloodPressureEntryUi` declares 28 abstract methods: `changeFocusToDiastolic`, `changeFocusToSystolic`, `setBpSavedResultAndFinish`, `hideBpErrorMessage`, `showSystolicLessThanDiastolicError`, `showSystolicLowError`, `showSystolicHighError`, `showDiastolicLowError`, `showDiastolicHighError`, `showSystolicEmptyError`, `showDiastolicEmptyError`, `setSystolic`, `setDiastolic`, `showRemoveBpButton`, `hideRemoveBpButton`, `showEnterNewBloodPressureTitle`, `showEditBloodPressureTitle`, `showConfirmRemoveBloodPressureDialog`, `showBpEntryScreen`, `showDateEntryScreen`, `showInvalidDateError`, `showDateIsInFutureError`, `hideDateErrorMessage`, `setDateOnInputFields`, `showBpDate`, `dismiss`, `showProgress`, `hideProgress`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryUi.kt:7
  • `ContactPatientUi` declares 33 abstract methods: `showProgress`, `hideProgress`, `switchToCallPatientView`, `switchToSetAppointmentReminderView`, `renderPatientDetails`, `showSecureCallUi`, `hideSecureCallUi`, `showNormalCallButtonText`, `showCallButtonText`, `showPatientWithNoPhoneNumberUi`, `hidePatientWithNoPhoneNumberUi`, `showPatientWithPhoneNumberUi`, `hidePatientWithPhoneNumberUi`, `setResultOfCallLabelText`, `setResultLabelText`, `setRegisterAtLabelText`, `setTransferredFromLabelText`, `showPatientWithPhoneNumberCallResults`, `hidePatientWithPhoneNumberCallResults`, `showPatientWithNoPhoneNumberResults`, `showDeadPatientStatus`, `hideDeadPatientStatus`, `renderSelectedAppointmentDate`, `disablePreviousReminderDateStepper`, `enablePreviousReminderDateStepper`, `disableNextReminderDateStepper`, `enableNextReminderDateStepper`, `showCallResult`, `hideCallResult`, `setupAgreedToVisitCallResultOutcome`, `setupRemindToCallLaterCallResultOutcome`, `setupRemovedFromListCallResultOutcome`, `setCallResultUpdatedAtDate`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/contactpatient/ContactPatientUi.kt:6
  • `RoomDao` declares 26 abstract methods: `withSyncStatus`, `withSyncStatusBatched`, `updateSyncStatus`, `updateSyncStatusForIdsRaw`, `save`, `softDelete`, `getOne`, `recordIdsWithSyncStatus`, `count`, `countWithStatus`, `forPatient`, `forPatientImmediate`, `clearData`, `prescription`, `prescriptionImmediate`, `hasPrescriptionForPatientChangedSince`, `hasPrescriptionForPatientChangedToday`, `purgeDeleted`, `updateDrugDuration`, `updateDrugFrequenecy`, `addTeleconsultationIdToDrugsRaw`, `softDeleteIdsRaw`, `getAllPrescribedDrugs`, `deleteWithoutLinkedPatient`, `purgePrescribedDrugWhenPatientIsNull`, `prescriptionCountImmediate`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/drugs/PrescribedDrug.kt:133
  • `EditPatientUi` declares 29 abstract methods: `displayBpPassports`, `setPatientName`, `setPatientPhoneNumber`, `setColonyOrVillage`, `setDistrict`, `setStreetAddress`, `setZone`, `setState`, `setGender`, `setPatientAge`, `setPatientDateOfBirth`, `setAlternateIdTextField`, `setAlternateIdContainer`, `showValidationErrors`, `hideValidationErrors`, `scrollToFirstFieldWithError`, `goBack`, `showDatePatternInDateOfBirthLabel`, `hideDatePatternInDateOfBirthLabel`, `setDateOfBirthAndAgeVisibility`, `showDiscardChangesAlert`, `showProgress`, `hideProgress`, `setupUi`, `setColonyOrVillagesAutoComplete`, `openSimpleScanIdScreen`, `showAddNHIDButton`, `hideAddNHIDButton`, `showIndiaNHIDLabel`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/editpatient/EditPatientUi.kt:9
  • `RoomDao` declares 18 abstract methods: `recordsWithSyncStatus`, `recordsWithSyncStatusBatched`, `updateSyncStatus`, `updateSyncStatusForIdsRaw`, `getOne`, `recordIdsWithSyncStatus`, `save`, `saveHistories`, `count`, `countWithStatus`, `clear`, `historyForPatient`, `historyForPatientImmediate`, `hasMedicalHistoryForPatientChangedSinceImmediate`, `purgeDeleted`, `getAllMedicalHistories`, `deleteWithoutLinkedPatient`, `purgeMedicalHistoryWhenPatientIsNull`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistory.kt:141
  • `PatientEntryUiActions` declares 18 abstract methods: `prefillFields`, `scrollToFirstFieldWithError`, `scrollFormOnGenderSelection`, `setShowDatePatternInDateOfBirthLabel`, `openMedicalHistoryEntryScreen`, `showEmptyFullNameError`, `showLengthTooShortPhoneNumberError`, `showMissingGenderError`, `showEmptyColonyOrVillageError`, `showEmptyDistrictError`, `showEmptyStateError`, `showEmptyDateOfBirthAndAgeError`, `showInvalidDateOfBirthError`, `showDateOfBirthIsInFutureError`, `showAgeExceedsMaxLimitError`, `showDOBExceedsMaxLimitError`, `showAgeExceedsMinLimitError`, `showDOBExceedsMinLimitError`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/newentry/PatientEntryUiActions.kt:6
  • `RoomDao` declares 28 abstract methods: `recordsWithSyncStatus`, `recordsWithSyncStatusBatched`, `updateSyncStatus`, `updateSyncStatusForIdsRaw`, `getOne`, `recordIdsWithSyncStatus`, `save`, `lastCreatedAppointmentForPatient`, `count`, `countWithStatus`, `markOlderAppointmentsAsVisited`, `saveRemindDate`, `markAsAgreedToVisit`, `markAsVisited`, `cancelWithReason`, `clear`, `markAsVisitedForPatient`, `purgeDeleted`, `purgeUnusedAppointments`, `getAllAppointments`, `getAllAppointmentsForPatient`, `deleteWithoutLinkedPatient`, `purgeAppointmentsWhenPatientIsNull`, `latestOverdueAppointmentForPatient`, `nextAppointmentPatientProfile`, `hasAppointmentForPatientChangedSince`, `latestScheduledAppointmentForPatient`, `appointmentAndPatientInformationForIds`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/overdue/Appointment.kt:164
  • `RoomDao` declares 34 abstract methods: `allPatients`, `getOne`, `recordIdsWithSyncStatus`, `patient`, `patientImmediate`, `updateSyncStatus`, `updateSyncStatusForIdsRaw`, `patientCount`, `patientCountWithStatus`, `clear`, `findPatientsWithBusinessId`, `findPatientsWithBusinessIdImmediate`, `updatePatientStatus`, `compareAndUpdateRecordedAt`, `updateRecordedAt`, `deletePatient`, `updateAssignedFacilityId`, `recordsWithSyncStatus`, `patientProfile`, `patientProfileImmediate`, `allPatientProfiles`, `profilesWithSyncStatusBatched`, `isPatientDefaulter`, `hasPatientChangedSince`, `purgeDeleted`, `purgeDeletedPhoneNumbers`, `purgeDeletedBusinessIds`, `deletePatientsNotInFacilitiesRaw`, `purgePatientAfterRetentionTime`, `contactPatientProfileImmediate`, `villageAndPatientNamesInFacility`, `patientLineListRows`, `patientLineListCount`, `updatePatientReassignmentEligibilityStatus`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/patient/Patient.kt:85
  • `PatientSummaryScreenUi` declares 21 abstract methods: `renderPatientSummaryToolbar`, `populatePatientProfile`, `showDiabetesView`, `hideDiabetesView`, `showTeleconsultButton`, `hideTeleconsultButton`, `showAssignedFacilityView`, `hideAssignedFacilityView`, `hideDoneButton`, `showTeleconsultLogButton`, `hidePatientDiedStatus`, `showPatientDiedStatus`, `showNextAppointmentCard`, `hideNextAppointmentCard`, `showClinicalDecisionSupportAlert`, `hideClinicalDecisionSupportAlert`, `hideClinicalDecisionSupportAlertWithoutAnimation`, `updateStatinNudge`, `showBMIView`, `hideBMIView`, `updateCVDRiskView`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/summary/PatientSummaryScreenUi.kt:7
  • `PatientSummaryUiActions` declares 26 abstract methods: `showScheduleAppointmentSheet`, `showEditPatientScreen`, `goToPreviousScreen`, `goToHomeScreen`, `showUpdatePhoneDialog`, `showAddPhoneDialog`, `showLinkIdWithPatientView`, `showDiagnosisRequiredError`, `showDiagnosisOrReferralRequiredError`, `showHypertensionDiagnosisRequiredError`, `showHypertensionDiagnosisOrReferralRequiredError`, `openPatientContactSheet`, `navigateToTeleconsultRecordScreen`, `openContactDoctorSheet`, `showAddMeasurementsWarningDialog`, `showAddBloodPressureWarningDialog`, `showAddBloodSugarWarningDialog`, `openSelectFacilitySheet`, `dispatchNewAssignedFacility`, `refreshNextAppointment`, `showReassignPatientWarningSheet`, `showDiabetesDiagnosisWarning`, `showHypertensionDiagnosisWarning`, `showTobaccoStatusDialog`, `openBMIEntrySheet`, `openCholesterolEntrySheet`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/src/main/java/org/simple/clinic/summary/PatientSummaryUiActions.kt:9

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
C1 · Data Protection5.0 / 10Adequate✓ Tool-verified

Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.

Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.

What to do

  • Strengthen data-at-rest protection: vault your keys (AWS KMS / Secrets Manager, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault — not a key compiled into the app) and encrypt the store that holds the personal data (SQLCipher, a Realm encryptionKey, field-level AEAD) — partial coverage still leaves gaps.
  • Enforce HTTPS on the server that receives this data: terminate TLS in it (Ktor's sslConnector, Spring's server.ssl and requiresSecure, Netty's SslContextBuilder.forServer) and send Strict-Transport-Security (Ktor's HttpsRedirect), or run it behind a TLS-terminating proxy, so data in transit is always encrypted.
C4 · Data Retention7.5 / 10Strong✓ Tool-verified

Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).

Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.

  • A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a scheduled purge / cleanup job (a periodic worker or scheduled task that deletes rows past their retention — @Query("DELETE … WHERE createdAt < :cutoff"), deleteWhere { createdAt less cutoff }, purgeExpired… / deleteOld…).

What to do

  • Complete the data-lifecycle story: an expiry limit (a declared maximum age for the stored data — a retention-age setting, or a store-level TTL where your storage offers one), a scheduled purge/cleanup job that enforces it, and a documented retention period covering the personal data.
DM10 · One transaction, one aggregate9.2 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether a single operation mutates more than one aggregate root. An aggregate is a consistency boundary, so saving two together fuses them into one — the second's invariants come to depend on the first's transaction, and the pair can no longer be separated. Reads of other aggregates are not counted.

Method: Neutral body surface (DDD-gated): every method body scanned for repository WRITE calls (Add/Update/Save/Remove/Delete/Insert/Store and their async forms), keyed on the ARGUMENT type rather than the repository type — three `IRepository<T>` writes collapse to one repository but are three distinct aggregates. Reads (Get/Find/Load/Query) are excluded, so loading another aggregate for context never counts. Score is offending methods over methods that write at all. Deterministic.

  • `FakeDataGenerationReceiver.generateFakeData` saves `PatientRepository`, `BloodPressureRepository`, `AppointmentRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — app/src/debug/java/org/simple/clinic/FakeDataGenerationReceiver.kt:86
  • `NewMedicalHistoryEffectHandler.registerPatient` saves ``, `UUID` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryEffectHandler.kt:56

What to do

  • Mutate one aggregate per operation and let the others follow from a domain event — the second aggregate reaching consistency a moment later is the design, not a compromise.
DM11 · Constructible invalid state6.2 / 10Adequate✓ Tool-verified

Other · Domain Modelling — Whether an aggregate can be constructed in a state its own rules forbid — a public constructor that takes a raw primitive, stores it, and validates nothing, with no factory beside it. A constructor taking only value objects is not counted: each parameter has already validated itself.

Method: Neutral surface (DDD-gated): each non-abstract entity/aggregate checked for a PUBLIC constructor taking at least one RAW PRIMITIVE parameter whose body contains no guard token (throw / Guard. / Ensure. / ArgumentException / CheckRule / an XException.ThrowIf* helper). C#: a static factory beside a public constructor does not exempt it, and a public parameterless constructor followed by public raw-primitive setters that refuse nothing is charged when the type also declares a validating way in (a guarded constructor or a guarding static method returning the type); TypeScript: a static Create/Of/From/New factory exempts the type. A constructor taking only value objects is never charged -- measured: 64 of 87 unguarded public constructors on the C# corpus take value objects only, so ignoring parameter types would be 73% false positives. One finding per entity. Deterministic.

  • `PrescribedDrug`'s public constructor takes `name`, `dosage`, `rxNormCode` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PrescribedDrug` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/drugs/PrescribedDrug.kt:37
  • `Drug`'s public constructor takes `name`, `composition`, `dosage`, `rxNormCode` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `Drug` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/drugs/search/Drug.kt:16
  • `Facility`'s public constructor takes `name`, `facilityType`, `streetAddress`, `villageOrColony`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `Facility` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/facility/Facility.kt:22
  • `Patient`'s public constructor takes `fullName` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `Patient` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/patient/Patient.kt:39
  • `PatientFts`'s public constructor takes `fullName` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PatientFts` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/patient/Patient.kt:507
  • `PatientAddress`'s public constructor takes `streetAddress`, `colonyOrVillage`, `zone`, `district`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PatientAddress` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/patient/PatientAddress.kt:18
  • `PatientAddressFts`'s public constructor takes `colonyOrVillage` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PatientAddressFts` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/patient/PatientAddress.kt:110
  • `PatientPhoneNumber`'s public constructor takes `number` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PatientPhoneNumber` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/patient/PatientPhoneNumber.kt:32
  • `PatientPhoneNumberFts`'s public constructor takes `number` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PatientPhoneNumberFts` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/patient/PatientPhoneNumber.kt:92
  • `BusinessId`'s public constructor takes `metaData`, `searchHelp` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BusinessId` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/patient/businessid/BusinessId.kt:53
  • `BusinessIdFts`'s public constructor takes `searchHelp` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BusinessIdFts` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/patient/businessid/BusinessId.kt:217
  • `Protocol`'s public constructor takes `name` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `Protocol` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/protocol/Protocol.kt:21
  • `ProtocolDrug`'s public constructor takes `name`, `rxNormCode`, `dosage` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `ProtocolDrug` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/protocol/ProtocolDrug.kt:31
  • `TextRecord`'s public constructor takes `id`, `text` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `TextRecord` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/storage/text/TextRecord.kt:12
  • `MedicalOfficer`'s public constructor takes `fullName`, `phoneNumber` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `MedicalOfficer` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/summary/teleconsultation/sync/MedicalOfficer.kt:16
  • `OngoingLoginEntry`'s public constructor takes `phoneNumber`, `pin`, `fullName`, `pinDigest`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `OngoingLoginEntry` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/user/OngoingLoginEntry.kt:18
  • `User`'s public constructor takes `fullName`, `phoneNumber`, `pinDigest`, `teleconsultPhoneNumber` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `User` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/org/simple/clinic/user/User.kt:35

What to do

  • Give each aggregate one way in that can refuse — a guarded constructor, value-object parameters that validate themselves, or a private constructor behind a factory that returns a failure.
DM4 · Rich vs anemic model3.0 / 10Weak✓ Tool-verified

Other · Domain Modelling — Whether aggregates/entities carry the behaviour that protects their invariants, rather than being data bags driven by external services.

Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.

Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.

  • `BloodSugarMeasurement` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:34
  • `BloodPressureMeasurement` is an aggregate/entity with 11 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/bp/BloodPressureMeasurement.kt:34
  • `CVDRisk` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/cvdrisk/CVDRisk.kt:27
  • `PrescribedDrug` is an aggregate/entity with 16 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/drugs/PrescribedDrug.kt:37
  • `Drug` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/drugs/search/Drug.kt:16
  • `Facility` is an aggregate/entity with 18 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/facility/Facility.kt:22
  • `MedicalHistory` is an aggregate/entity with 22 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistory.kt:40
  • `Appointment` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/overdue/Appointment.kt:37
  • `CallResult` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/overdue/callresult/CallResult.kt:32
  • `Patient` is an aggregate/entity with 17 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/patient/Patient.kt:39
  • `PatientFts` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/patient/Patient.kt:507
  • `PatientAddress` is an aggregate/entity with 11 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/patient/PatientAddress.kt:18
  • `PatientAddressFts` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/patient/PatientAddress.kt:110
  • `PatientPhoneNumber` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/patient/PatientPhoneNumber.kt:32
  • `PatientPhoneNumberFts` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/patient/PatientPhoneNumber.kt:92
  • `BusinessIdFts` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/patient/businessid/BusinessId.kt:217
  • `PatientAttribute` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/patientattribute/PatientAttribute.kt:27
  • `Protocol` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/protocol/Protocol.kt:21
  • `ProtocolDrug` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/protocol/ProtocolDrug.kt:31
  • `Questionnaire` is an aggregate/entity with 4 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/questionnaire/Questionnaire.kt:19
  • `QuestionnaireResponse` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/questionnaireresponse/QuestionnaireResponse.kt:25
  • `ReturnScore` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/returnscore/ReturnScore.kt:23
  • `TextRecord` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/storage/text/TextRecord.kt:12
  • `MissingPhoneReminder` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/summary/addphone/MissingPhoneReminder.kt:14
  • `MedicalOfficer` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/summary/teleconsultation/sync/MedicalOfficer.kt:16
  • `TeleconsultationFacilityInfo` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/summary/teleconsultation/sync/TeleconsultationFacilityInfo.kt:16
  • `TeleconsultationFacilityMedicalOfficersCrossRef` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/summary/teleconsultation/sync/TeleconsultationFacilityWithMedicalOfficers.kt:17
  • `TeleconsultRecord` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/TeleconsultRecord.kt:22
  • `User` is an aggregate/entity with 20 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/org/simple/clinic/user/User.kt:35

What to do

  • Move business rules onto the aggregates/entities they govern so invariants are enforced at the source, not in anemic services.
DM5 · Encapsulated state10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether entities protect their state — private/init-only setters, and collections handed out as read-only views rather than the mutable backing collection — instead of exposing writable state that bypasses invariants. Softened when a rehydration framework (Marten/EF) is present.

Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.

Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.

DM7 · Repository granularity10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether repositories are per aggregate root (not per child entity) and keep the persistence query handle behind the contract, so the root's invariants can't be bypassed.

Method: Roslyn (DDD-gated): repository abstraction detection; repositories over non-aggregate-root entities flagged, and (C#/VB) repository INTERFACES whose members return a live persistence query handle (IQueryable/DbSet/IMongoQueryable) — implementations and specification evaluators are out of population by design, since composing a query internally is what an implementation is for. Deterministic, DDD-native.

Coverage: Population: repositories + aggregate roots by NAME convention; per-root repository rule checked within the set.

DM9 · Scattered domain decisions10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.

Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.

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

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

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

M2 · Architecture documentation8.0 / 10Strong✓ 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.

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.

P3 · Security & performance tooling3.0 / 10Weak✓ Tool-verified

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

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

  • No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 6 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:4

What to do

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

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

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

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

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

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

PF1 · Benchmark discipline8.0 / 10Strong✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

  • A JMH/Jetpack Benchmark suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured.

What to do

  • Run JMH with the GC profiler (`-prof gc`, or addProfiler(GCProfiler.class)) so allocation rate regressions are visible, not just time.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

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

Other · Code Health — 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.

X3 · Exception handling5.0 / 10Weak✓ 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.

  • `catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×5) — app/src/main/java/org/simple/clinic/util/moshi/MapWithAnyValueTypeMoshiAdapter.kt:20, app/src/main/java/org/simple/clinic/monthlyreports/util/StringFormatter.kt:13, app/src/main/java/org/simple/clinic/monthlyreports/util/StringFormatter.kt:21, …
  • `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — app/src/main/java/org/simple/clinic/storage/DatabaseEncryptor.kt:129
  • `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — app/src/main/java/org/simple/clinic/patient/PatientRepository.kt:767
  • 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. — app/src/main/java/org/simple/clinic/monthlyreports/form/compose/QuestionnaireInputField.kt:111
  • `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — app/src/main/java/org/simple/clinic/monthlyreports/form/compose/QuestionnaireUnorderedListItem.kt:62

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

X5 · Nullable reference types9.4 / 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 Health79.9StrongSolid.
Architecture91.3ExemplaryStrongest area.
Maturity80.6Adequate — gated by D34Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness69.7Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security59.9Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling66.2Adequate — gated by DM4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance88.6StrongSolid.
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.

  • X10 Duplicated predicate — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 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 — Repo shows no audit-logging mechanism (an audit-log table or model — an Exposed table, a data class, a Room entity or a SQL migration's table named for it — Hibernate Envers' @Audited, a JPA entity listener, Hibernate event listener or jOOQ RecordListener that records each change) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
  • C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 69 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 applicable: Dagger rejects, at compile time, a component that holds a binding with a narrower scope than its own.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads.
  • AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the Android app did not build — `./gradlew :app:assembleDebug` exited 1: com.github.requery:sqlite-android:3.49.0. > Could not get resource 'https://jitpack.io/com/github/requery/sqlite-android/3.49.0/sqlite-android-3.49.0.pom'. > Could not GET 'https…; runtime evidence skipped (launch chosen because app/build.gradle.kts applies the Android application plugin and gradlew builds it) This is a statement about this run, not a statement about your application: nothing here says the app is inaccessible, only that it was never run.
  • 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 — ~75113 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.
  • D11 Test Reliability — Test reliability not included — the .kt suite was found but not re-run
  • D12 Dependency Hygiene — Not scored — a Gradle build resolved 524 artifact(s) across its subprojects (148 behind a shipped release, reported), but the currency signal was not established over the whole graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .kt, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — None of 8 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • 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) and a Gradle version catalogue — 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) — 9 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) and a Gradle version catalogue — not scanned yet).
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Aggregate boundaries — no aggregates detected — aggregate-boundary check not applicable
  • DM12 Ambient inputs in the domain — no domain-layer types detected — ambient-input check not applicable
  • DM2 Strongly-typed ids — no id-bearing domain types detected — strongly-typed-id adoption not assessable
  • DM3 Integration-event coupling — no integration events detected — coupling check not applicable
  • DM6 Domain ↔ infrastructure boundary — no domain-layer types detected — domain↔infrastructure boundary check not applicable
  • DM8 Value-object opportunities — not scored — the deterministic rule found 0 candidate clump(s); its rows are withheld until it has a measured precision of 95 % (a sample of fewer than 10 rows cannot show one)
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this lens looks for (52 CQRS handler(s))
  • ED5 Idempotency — Not assessed, and this one is on us: 52 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
  • 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
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P2 Observability — This repository's JVM source (7 module(s), 2002 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
  • 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.
  • 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.
  • 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 — 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
  • 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
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — 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
  • 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
  • X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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.
  • 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 — 44 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 11 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 362 finding(s)
D17 · Explicit Debt · TodoComment · ×37
  • TodoComment app/src/test/java/org/simple/clinic/user/resetpin/ResetUserPinTest.kt:169 — // TODO(vs): 2019-11-22 This is coupled to the implementation. Refactor later. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/test/java/org/simple/clinic/user/resetpin/ResetUserPinTest.kt:186 — // TODO(vs): 2019-11-22 This is coupled to the implementation. Refactor later. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/test/java/org/simple/clinic/newentry/PatientEntryScreenLogicTest.kt:253 — // TODO(rj): 2019-10-04 This test keeps passing no matter what, I verified if the exception is being thrown — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/test/java/org/simple/clinic/newentry/PatientEntryScreenLogicTest.kt:410 — // TODO: Write these similarly structured regression tests in a smarter way. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/test/java/org/simple/clinic/newentry/PatientEntryScreenLogicTest.kt:478 — // TODO (vs) 27/10/20: Tighten assertions in this test` — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/test/java/org/simple/clinic/login/LoginUserWithOtpTest.kt:142 — // TODO(vs): 2019-11-15 This is tied to the implementation detail, extract to another class — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/test/java/org/simple/clinic/editpatient/EditPatientEffectHandlerTest.kt:219 — // TODO: 02/06/20 This is nasty, we need to fix the flow for registering patients — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/test/java/org/simple/clinic/bp/entry/BloodPressureValidationMockDateValidatorTest.kt:78 — // TODO(rj): 2019-10-10 There isn't a straight-forward way to set a time in the date validator as of now. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/test/java/org/simple/clinic/bp/entry/BloodPressureValidationMockDateValidatorTest.kt:79 — // TODO We'll rely on mocks to test this code path (showDateIsInFutureError) for now. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/util/UserInputDatePaddingCharacter.kt:3 — // TODO: Convert to inline class once they become stable. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/user/resetpin/ResetUserPin.kt:28 — // TODO(vs): 2019-11-21 Unify the LoginApi and RegistrationApi into a single UserApi — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/user/refreshuser/RefreshCurrentUser.kt:52 — // TODO: This was added to handle the case where the user logged in status will — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorView.kt:143 — // TODO(vs): 2019-10-31 Add a separate error message for server errors — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:550 — // TODO(vs): 2020-02-19 Revisit after Mobius migration — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/summary/PatientSummaryEvent.kt:25 — // TODO(vs): 2020-01-15 Consider whether these should be moved to the effect handler as properties later — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/summary/PatientSummaryEvent.kt:33 — // TODO(vs): 2020-01-16 Consider whether these should be moved to the effect handler as properties later — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/summary/PatientSummaryScreenKey.kt:16 — // TODO(vs): 2019-10-18 Move this to the UI model when migrating to Mobius — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/summary/teleconsultation/messagebuilder/ShortTeleconsultMessageBuilder.kt:8 — // TODO (SM): 2020-08-24 Change the deep link — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneEvent.kt:21 — // TODO (vs) 04/06/20: https://www.pivotaltracker.com/story/show/173170198
  • TodoComment app/src/main/java/org/simple/clinic/recentpatientsview/LatestRecentPatientsInit.kt:20 — // TODO (vs) 09/07/20: Move this hack to a separate flow — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/protocol/sync/ProtocolPayload.kt:32 — // TODO: Backend is supposed to make this non-null. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/patient/Answer.kt:34 — // TODO 16-Jul-19 : See if it's possible to change this in a future api version — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/medicalhistory/Answer.kt:42 — // TODO 16-Jul-19 : See if it's possible to change this in a future api version — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/patient/PhoneNumberDetails.kt:3 — // TODO: 01/06/20 Make this an embedded model in `PatientPhoneNumber` — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/org/simple/clinic/patient/businessid/Identifier.kt:66 — // TODO (SM): Get more information on the crash and resolve the issue accordingly — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 12 more in this group — see findings.md.
DM4 · Rich vs anemic model · Anemic entity · ×29
  • Anemic entity: BloodSugarMeasurement app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:34 — `BloodSugarMeasurement` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: BloodPressureMeasurement app/src/main/java/org/simple/clinic/bp/BloodPressureMeasurement.kt:34 — `BloodPressureMeasurement` is an aggregate/entity with 11 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: CVDRisk app/src/main/java/org/simple/clinic/cvdrisk/CVDRisk.kt:27 — `CVDRisk` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: PrescribedDrug app/src/main/java/org/simple/clinic/drugs/PrescribedDrug.kt:37 — `PrescribedDrug` is an aggregate/entity with 16 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Drug app/src/main/java/org/simple/clinic/drugs/search/Drug.kt:16 — `Drug` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Facility app/src/main/java/org/simple/clinic/facility/Facility.kt:22 — `Facility` is an aggregate/entity with 18 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: MedicalHistory app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistory.kt:40 — `MedicalHistory` is an aggregate/entity with 22 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Appointment app/src/main/java/org/simple/clinic/overdue/Appointment.kt:37 — `Appointment` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: CallResult app/src/main/java/org/simple/clinic/overdue/callresult/CallResult.kt:32 — `CallResult` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Patient app/src/main/java/org/simple/clinic/patient/Patient.kt:39 — `Patient` is an aggregate/entity with 17 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: PatientFts app/src/main/java/org/simple/clinic/patient/Patient.kt:507 — `PatientFts` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: PatientAddress app/src/main/java/org/simple/clinic/patient/PatientAddress.kt:18 — `PatientAddress` is an aggregate/entity with 11 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: PatientAddressFts app/src/main/java/org/simple/clinic/patient/PatientAddress.kt:110 — `PatientAddressFts` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: PatientPhoneNumber app/src/main/java/org/simple/clinic/patient/PatientPhoneNumber.kt:32 — `PatientPhoneNumber` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: PatientPhoneNumberFts app/src/main/java/org/simple/clinic/patient/PatientPhoneNumber.kt:92 — `PatientPhoneNumberFts` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: BusinessIdFts app/src/main/java/org/simple/clinic/patient/businessid/BusinessId.kt:217 — `BusinessIdFts` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: PatientAttribute app/src/main/java/org/simple/clinic/patientattribute/PatientAttribute.kt:27 — `PatientAttribute` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Protocol app/src/main/java/org/simple/clinic/protocol/Protocol.kt:21 — `Protocol` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: ProtocolDrug app/src/main/java/org/simple/clinic/protocol/ProtocolDrug.kt:31 — `ProtocolDrug` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Questionnaire app/src/main/java/org/simple/clinic/questionnaire/Questionnaire.kt:19 — `Questionnaire` is an aggregate/entity with 4 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: QuestionnaireResponse app/src/main/java/org/simple/clinic/questionnaireresponse/QuestionnaireResponse.kt:25 — `QuestionnaireResponse` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: ReturnScore app/src/main/java/org/simple/clinic/returnscore/ReturnScore.kt:23 — `ReturnScore` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: TextRecord app/src/main/java/org/simple/clinic/storage/text/TextRecord.kt:12 — `TextRecord` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: MissingPhoneReminder app/src/main/java/org/simple/clinic/summary/addphone/MissingPhoneReminder.kt:14 — `MissingPhoneReminder` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: MedicalOfficer app/src/main/java/org/simple/clinic/summary/teleconsultation/sync/MedicalOfficer.kt:16 — `MedicalOfficer` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • + 4 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×24
  • Low cohesion: BloodPressureEntrySheet (LCOM4 9) app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntrySheet.kt:59 — BloodPressureEntrySheet's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DeepLinkActivity (LCOM4 9) app/src/main/java/org/simple/clinic/deeplink/DeepLinkActivity.kt:25 — DeepLinkActivity's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: TeleconsultDoctorInfoView (LCOM4 8) app/src/main/java/org/simple/clinic/teleconsultlog/prescription/doctorinfo/TeleconsultDoctorInfoView.kt:27 — TeleconsultDoctorInfoView's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PatientsTabLinkView (LCOM4 6) app/src/main/java/org/simple/clinic/home/patients/links/PatientsTabLinkView.kt:30 — PatientsTabLinkView's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: BloodPressureHistoryScreen (LCOM4 5) app/src/main/java/org/simple/clinic/bp/history/BloodPressureHistoryScreen.kt:46 — BloodPressureHistoryScreen's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DrugsSearchScreen (LCOM4 5) app/src/main/java/org/simple/clinic/drugs/search/DrugsSearchScreen.kt:41 — DrugsSearchScreen's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: AlertFacilityChangeSheet (LCOM4 5) app/src/main/java/org/simple/clinic/facility/alertchange/AlertFacilityChangeSheet.kt:36 — AlertFacilityChangeSheet's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: InstantSearchScreen (LCOM4 5) app/src/main/java/org/simple/clinic/instantsearch/InstantSearchScreen.kt:73 — InstantSearchScreen's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: RegistrationFacilitySelectionScreen (LCOM4 5) app/src/main/java/org/simple/clinic/registration/facility/RegistrationFacilitySelectionScreen.kt:33 — RegistrationFacilitySelectionScreen's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SetupActivity (LCOM4 5) app/src/main/java/org/simple/clinic/setup/SetupActivity.kt:42 — SetupActivity's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: TeleconsultStatusSheet (LCOM4 5) app/src/main/java/org/simple/clinic/summary/teleconsultation/status/TeleconsultStatusSheet.kt:33 — TeleconsultStatusSheet's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: MedicineFrequencySheet (LCOM4 5) app/src/main/java/org/simple/clinic/teleconsultlog/medicinefrequency/MedicineFrequencySheet.kt:35 — MedicineFrequencySheet's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: TeleconsultSharePrescriptionScreen (LCOM4 5) app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionScreen.kt:52 — TeleconsultSharePrescriptionScreen's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DeletePatientScreen (LCOM4 4) app/src/main/java/org/simple/clinic/editpatient/deletepatient/DeletePatientScreen.kt:34 — DeletePatientScreen's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: RegistrationLoadingScreen (LCOM4 4) app/src/main/java/org/simple/clinic/registration/register/RegistrationLoadingScreen.kt:26 — RegistrationLoadingScreen's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ScanSimpleIdScreen (LCOM4 4) app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdScreen.kt:61 — ScanSimpleIdScreen's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ScheduleAppointmentEffectHandler (LCOM4 4) app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffectHandler.kt:31 — ScheduleAppointmentEffectHandler's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SignatureActivity (LCOM4 4) app/src/main/java/org/simple/clinic/signature/SignatureActivity.kt:18 — SignatureActivity's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: BloodPressureSummaryView (LCOM4 4) app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummaryView.kt:69 — BloodPressureSummaryView's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DataSync (LCOM4 4) app/src/main/java/org/simple/clinic/sync/DataSync.kt:39 — DataSync's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SyncIndicatorView (LCOM4 4) app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorView.kt:36 — SyncIndicatorView's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DrugDurationSheet (LCOM4 4) app/src/main/java/org/simple/clinic/teleconsultlog/drugduration/DrugDurationSheet.kt:33 — DrugDurationSheet's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: TeleconsultMedicinesView (LCOM4 4) app/src/main/java/org/simple/clinic/teleconsultlog/prescription/medicines/TeleconsultMedicinesView.kt:41 — TeleconsultMedicinesView's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: MobiusTestFixture (LCOM4 4) mobius-migration/src/main/java/org/simple/mobius/migration/MobiusTestFixture.kt:21 — MobiusTestFixture's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D3 · God Classes · TooManyMethods · ×18
  • TooManyMethods: PatientSummaryScreen app/src/main/java/org/simple/clinic/summary/PatientSummaryScreen.kt:95 — TooManyMethods — 77 methods. The bar is 30 methods; this is 47 over it, 2.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: EditPatientScreen app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:111 — TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PatientRepository app/src/main/java/org/simple/clinic/patient/PatientRepository.kt:47 — TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ContactPatientBottomSheet app/src/main/java/org/simple/clinic/contactpatient/ContactPatientBottomSheet.kt:55 — TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BloodSugarEntrySheet app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.kt:64 — TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× 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: BloodPressureEntrySheet app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntrySheet.kt:59 — TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× 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: PatientEntryScreen app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt:88 — TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× 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: AppDatabase app/src/main/java/org/simple/clinic/AppDatabase.kt:156 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PatientsTabScreen app/src/main/java/org/simple/clinic/home/patients/PatientsTabScreen.kt:68 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: InstantSearchScreen app/src/main/java/org/simple/clinic/instantsearch/InstantSearchScreen.kt:73 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ScheduleAppointmentSheet app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentSheet.kt:51 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Router app/src/main/java/org/simple/clinic/navigation/v2/Router.kt:21 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RoomDao app/src/main/java/org/simple/clinic/patient/Patient.kt:85 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CustomDrugEntrySheet app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntrySheet.kt:44 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OverdueSearchScreen app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchScreen.kt:69 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PatientSummaryEffectHandler app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:55 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RoomDao app/src/main/java/org/simple/clinic/drugs/PrescribedDrug.kt:133 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ScanSimpleIdScreen app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdScreen.kt:61 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
DM11 · Constructible invalid state · Constructible in an invalid state · ×17
  • Constructible in an invalid state: PrescribedDrug app/src/main/java/org/simple/clinic/drugs/PrescribedDrug.kt:37 — `PrescribedDrug`'s public constructor takes `name`, `dosage`, `rxNormCode` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PrescribedDrug` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: Drug app/src/main/java/org/simple/clinic/drugs/search/Drug.kt:16 — `Drug`'s public constructor takes `name`, `composition`, `dosage`, `rxNormCode` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `Drug` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: Facility app/src/main/java/org/simple/clinic/facility/Facility.kt:22 — `Facility`'s public constructor takes `name`, `facilityType`, `streetAddress`, `villageOrColony`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `Facility` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: Patient app/src/main/java/org/simple/clinic/patient/Patient.kt:39 — `Patient`'s public constructor takes `fullName` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `Patient` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: PatientFts app/src/main/java/org/simple/clinic/patient/Patient.kt:507 — `PatientFts`'s public constructor takes `fullName` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PatientFts` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: PatientAddress app/src/main/java/org/simple/clinic/patient/PatientAddress.kt:18 — `PatientAddress`'s public constructor takes `streetAddress`, `colonyOrVillage`, `zone`, `district`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PatientAddress` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: PatientAddressFts app/src/main/java/org/simple/clinic/patient/PatientAddress.kt:110 — `PatientAddressFts`'s public constructor takes `colonyOrVillage` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PatientAddressFts` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: PatientPhoneNumber app/src/main/java/org/simple/clinic/patient/PatientPhoneNumber.kt:32 — `PatientPhoneNumber`'s public constructor takes `number` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PatientPhoneNumber` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: PatientPhoneNumberFts app/src/main/java/org/simple/clinic/patient/PatientPhoneNumber.kt:92 — `PatientPhoneNumberFts`'s public constructor takes `number` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PatientPhoneNumberFts` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: BusinessId app/src/main/java/org/simple/clinic/patient/businessid/BusinessId.kt:53 — `BusinessId`'s public constructor takes `metaData`, `searchHelp` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BusinessId` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: BusinessIdFts app/src/main/java/org/simple/clinic/patient/businessid/BusinessId.kt:217 — `BusinessIdFts`'s public constructor takes `searchHelp` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BusinessIdFts` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: Protocol app/src/main/java/org/simple/clinic/protocol/Protocol.kt:21 — `Protocol`'s public constructor takes `name` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `Protocol` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: ProtocolDrug app/src/main/java/org/simple/clinic/protocol/ProtocolDrug.kt:31 — `ProtocolDrug`'s public constructor takes `name`, `rxNormCode`, `dosage` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `ProtocolDrug` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: TextRecord app/src/main/java/org/simple/clinic/storage/text/TextRecord.kt:12 — `TextRecord`'s public constructor takes `id`, `text` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `TextRecord` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: MedicalOfficer app/src/main/java/org/simple/clinic/summary/teleconsultation/sync/MedicalOfficer.kt:16 — `MedicalOfficer`'s public constructor takes `fullName`, `phoneNumber` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `MedicalOfficer` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: OngoingLoginEntry app/src/main/java/org/simple/clinic/user/OngoingLoginEntry.kt:18 — `OngoingLoginEntry`'s public constructor takes `phoneNumber`, `pin`, `fullName`, `pinDigest`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `OngoingLoginEntry` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: User app/src/main/java/org/simple/clinic/user/User.kt:35 — `User`'s public constructor takes `fullName`, `phoneNumber`, `pinDigest`, `teleconsultPhoneNumber` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `User` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×14
  • Edited copy of a member (9 corresponding lines) app/src/main/java/org/simple/clinic/drugs/selection/custom/drugfrequency/country/CommonDrugFrequencyProvider.kt:12 — app/src/main/java/org/simple/clinic/drugs/selection/custom/drugfrequency/country/CommonDrugFrequencyProvider.kt:12-20 | app/src/main/java/org/simple/clinic/drugs/selection/custom/drugfrequency/country/EthiopiaDrugFrequencyProvider.kt:12-20 — 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) app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryEffectHandler.kt:45 — app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryEffectHandler.kt:45-54 | app/src/main/java/org/simple/clinic/monthlyreports/form/QuestionnaireEntryEffectHandler.kt:32-40 — 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) app/src/main/java/org/simple/clinic/overdue/download/OverdueDownloadWorker.kt:157 — app/src/main/java/org/simple/clinic/overdue/download/OverdueDownloadWorker.kt:157-165 | app/src/main/java/org/simple/clinic/patient/download/PatientLinetListDownloadWorker.kt:160-168 — 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) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUpdate.kt:124 — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUpdate.kt:124-142 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryUpdate.kt:160-168 — 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) app/src/main/java/org/simple/clinic/drugs/EditMedicinesEffectHandler.kt:57 — app/src/main/java/org/simple/clinic/drugs/EditMedicinesEffectHandler.kt:57-66 | app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/screen/TeleconsultRecordEffectHandler.kt:49-57 — 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) app/src/main/java/org/simple/clinic/cvdrisk/calculator/LabBasedCVDRiskCalculator.kt:31 — app/src/main/java/org/simple/clinic/cvdrisk/calculator/LabBasedCVDRiskCalculator.kt:31-40 | app/src/main/java/org/simple/clinic/cvdrisk/calculator/NonLabBasedCVDRiskCalculator.kt:28-36 — 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) app/src/main/java/org/simple/clinic/overdue/download/formatdialog/DownloadFailedErrorDialog.kt:13 — app/src/main/java/org/simple/clinic/overdue/download/formatdialog/DownloadFailedErrorDialog.kt:13-21 | app/src/main/java/org/simple/clinic/overdue/download/formatdialog/NotEnoughStorageErrorDialog.kt:13-21 — 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) app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:136 — app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:136-144 | app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloader.kt:79-87 — 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) app/src/main/java/org/simple/clinic/bp/BloodPressureRepository.kt:86 — app/src/main/java/org/simple/clinic/bp/BloodPressureRepository.kt:86-94 | app/src/main/java/org/simple/clinic/facility/FacilityRepository.kt:74-82 — 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) app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistoryRepository.kt:178 — app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistoryRepository.kt:178-186 | app/src/main/java/org/simple/clinic/overdue/AppointmentRepository.kt:202-210 — 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) app/src/main/java/org/simple/clinic/patient/PatientRepository.kt:117 — app/src/main/java/org/simple/clinic/patient/PatientRepository.kt:117-125 | app/src/main/java/org/simple/clinic/protocol/ProtocolRepository.kt:55-63 — 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) app/src/main/java/org/simple/clinic/appconfig/StatesFetcher.kt:31 — app/src/main/java/org/simple/clinic/appconfig/StatesFetcher.kt:31-39 | app/src/main/java/org/simple/clinic/di/network/RetrofitModule.kt:47-57 — 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) app/src/main/java/org/simple/clinic/editpatient/EditPatientInit.kt:11 — app/src/main/java/org/simple/clinic/editpatient/EditPatientInit.kt:11-22 | app/src/main/java/org/simple/clinic/newentry/PatientEntryInit.kt:8-16 — 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) app/src/main/java/org/simple/clinic/facility/change/FacilityChangeInit.kt:9 — app/src/main/java/org/simple/clinic/facility/change/FacilityChangeInit.kt:9-17 | app/src/main/java/org/simple/clinic/summary/medicalhistory/MedicalHistorySummaryInit.kt:9-17 — 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) · ×12
  • Edited copy of a member (8 corresponding lines) app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinEffectHandler.kt:35 — app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinEffectHandler.kt:35-42 | app/src/main/java/org/simple/clinic/login/applock/AppLockEffectHandler.kt:34-42 — 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) app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreenEffectHandler.kt:41 — app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreenEffectHandler.kt:41-48 | app/src/main/java/org/simple/clinic/bp/history/BloodPressureHistoryScreenEffectHandler.kt:44-51 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreenUpdate.kt:12 — app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreenUpdate.kt:12-19 | app/src/main/java/org/simple/clinic/bp/history/BloodPressureHistoryScreenUpdate.kt:12-19 — 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) app/src/main/java/org/simple/clinic/login/LoginUserWithOtp.kt:39 — app/src/main/java/org/simple/clinic/login/LoginUserWithOtp.kt:39-48 | app/src/main/java/org/simple/clinic/user/registeruser/RegisterUser.kt:76-83 — 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) app/src/main/java/org/simple/clinic/selectcountry/SelectCountryUpdate.kt:33 — app/src/main/java/org/simple/clinic/selectcountry/SelectCountryUpdate.kt:33-40 | app/src/main/java/org/simple/clinic/selectstate/SelectStateUpdate.kt:38-46 — 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) app/src/main/java/org/simple/clinic/security/pin/verification/LocalUserPinVerificationMethod.kt:17 — app/src/main/java/org/simple/clinic/security/pin/verification/LocalUserPinVerificationMethod.kt:17-25 | app/src/main/java/org/simple/clinic/security/pin/verification/OngoingLoginEntryPinVerificationMethod.kt:17-24 — 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) app/src/main/java/org/simple/clinic/summary/prescribeddrugs/DrugSummaryEffectHandler.kt:41 — app/src/main/java/org/simple/clinic/summary/prescribeddrugs/DrugSummaryEffectHandler.kt:41-48 | app/src/main/java/org/simple/clinic/teleconsultlog/prescription/medicines/TeleconsultMedicinesEffectHandler.kt:48-55 — 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) app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffectHandler.kt:80 — app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffectHandler.kt:80-87 | app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionEffectHandler.kt:91-98 — 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) app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchEffectHandler.kt:79 — app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchEffectHandler.kt:79-86 | app/src/main/java/org/simple/clinic/settings/SettingsEffectHandler.kt:107-114 — 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) app/src/main/java/org/simple/clinic/removeoverdueappointment/RemoveOverdueEffectHandler.kt:77 — app/src/main/java/org/simple/clinic/removeoverdueappointment/RemoveOverdueEffectHandler.kt:77-84 | app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdEffectHandler.kt:37-46 — 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) app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEffectHandler.kt:42 — app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEffectHandler.kt:42-49 | app/src/main/java/org/simple/clinic/enterotp/EnterOtpEffectHandler.kt:51-58 — 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) app/src/main/java/org/simple/clinic/home/help/HelpScreenEffectHandler.kt:34 — app/src/main/java/org/simple/clinic/home/help/HelpScreenEffectHandler.kt:34-41 | app/src/main/java/org/simple/clinic/settings/SettingsEffectHandler.kt:59-66 — 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 (8 lines × 2) · ×8
  • Duplicated block (8 lines × 2) app/src/main/java/org/simple/clinic/medicalhistory/ui/HistoryContainer.kt:30 — app/src/main/java/org/simple/clinic/medicalhistory/ui/HistoryContainer.kt:30-37 | app/src/main/java/org/simple/clinic/medicalhistory/ui/TobaccoContainer.kt:69-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/medicalhistory/ui/HistoryContainer.kt:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/org/simple/clinic/editpatient/EditPatientEffectHandler.kt:351 — app/src/main/java/org/simple/clinic/editpatient/EditPatientEffectHandler.kt:351-358 | app/src/main/java/org/simple/clinic/newentry/PatientEntryEffectHandler.kt:87-94 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinEffectHandler.kt:81 — app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinEffectHandler.kt:81-88 | app/src/main/java/org/simple/clinic/login/applock/AppLockEffectHandler.kt:71-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchEffectHandler.kt:131 — app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchEffectHandler.kt:131-138 | app/src/main/java/org/simple/clinic/overdue/download/formatdialog/SelectOverdueDownloadFormatEffectHandler.kt:38-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:479 — app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:479-486 | app/src/main/java/org/simple/clinic/summary/teleconsultation/contactdoctor/ContactDoctorEffectHandler.kt:129-136 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) app/src/main/java/org/simple/clinic/teleconsultlog/prescription/TeleconsultPrescriptionEffectHandler.kt:91 — app/src/main/java/org/simple/clinic/teleconsultlog/prescription/TeleconsultPrescriptionEffectHandler.kt:91-98 | app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/screen/TeleconsultRecordEffectHandler.kt:83-90 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) app/src/main/java/org/simple/clinic/facility/change/confirm/ConfirmFacilityChangeEffectHandler.kt:72 — app/src/main/java/org/simple/clinic/facility/change/confirm/ConfirmFacilityChangeEffectHandler.kt:72-79 | app/src/main/java/org/simple/clinic/login/pin/LoginPinEffectHandler.kt:71-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) app/src/main/java/org/simple/clinic/home/help/HelpScreenInit.kt:8 — app/src/main/java/org/simple/clinic/home/help/HelpScreenInit.kt:8-15 | app/src/main/java/org/simple/clinic/summary/teleconsultation/contactdoctor/ContactDoctorInit.kt:9-16 — 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×8
  • Swallowed exception (caught, then discarded) app/src/main/java/org/simple/clinic/util/moshi/MapWithAnyValueTypeMoshiAdapter.kt:20 — `catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/org/simple/clinic/storage/DatabaseEncryptor.kt:129 — `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/org/simple/clinic/patient/PatientRepository.kt:767 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/org/simple/clinic/monthlyreports/util/StringFormatter.kt:13 — `catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/org/simple/clinic/monthlyreports/util/StringFormatter.kt:21 — `catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/org/simple/clinic/monthlyreports/util/StringFormatter.kt:30 — `catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/org/simple/clinic/monthlyreports/form/compose/QuestionnaireInputField.kt:77 — `catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/org/simple/clinic/monthlyreports/form/compose/QuestionnaireUnorderedListItem.kt:62 — `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D35 · Change Coupling · Change coupling · ×7
  • Change coupling: AppDatabase.kt ↔ RoomMigrationsModule.kt app/src/main/java/org/simple/clinic/AppDatabase.kt:1 — `app/src/main/java/org/simple/clinic/AppDatabase.kt` and `app/src/main/java/org/simple/clinic/storage/migrations/RoomMigrationsModule.kt` change together 98% of the time (59 of the 60 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 59 shared commits counted here, the most recent 3 are `2ea16b5f` Add `ReturnScore` table (#5751); `a65d71e1` Add `hypertensionDiagnosedAt` and `diabetesDiagnosedAt` (#5661); `afeb9c5b` Add `isUsingSmokelessTobacco` in `MedicalHistory` table (#5531) — run `git show` on any of them.
  • Change coupling: MedicalHistoryPayload.kt ↔ MedicalHistorySync.kt app/src/main/java/org/simple/clinic/medicalhistory/sync/MedicalHistoryPayload.kt:1 — `app/src/main/java/org/simple/clinic/medicalhistory/sync/MedicalHistoryPayload.kt` and `app/src/main/java/org/simple/clinic/medicalhistory/sync/MedicalHistorySync.kt` change together 75% of the time (12 of the 16 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 12 shared commits counted here, the most recent 3 are `a65d71e1` Add `hypertensionDiagnosedAt` and `diabetesDiagnosedAt` (#5661); `ed1b05e2` Sync `smokeless_tobacco` with server (#5530); `4b34d71b` Add `cholesterol_value` to medical history table (#5260) — run `git show` on any of them.
  • Change coupling: PatientSummaryEffectHandler.kt ↔ PatientSummaryUiActions.kt app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:1 — `app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt` and `app/src/main/java/org/simple/clinic/summary/PatientSummaryUiActions.kt` change together 74% of the time (20 of the 27 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 20 shared commits counted here, the most recent 3 are `f567bc55` Calculate and load lab-based statin info if lab based statin nudge fe…; `a92004c5` Add smoking and bmi buttons to statin nudge (#5163); `887abeb7` Nudge users to mark HTN diagnosis if HTN medicines are added (#4984) — run `git show` on any of them.
  • Change coupling: PatientSummaryEffect.kt ↔ PatientSummaryEvent.kt app/src/main/java/org/simple/clinic/summary/PatientSummaryEffect.kt:1 — `app/src/main/java/org/simple/clinic/summary/PatientSummaryEffect.kt` and `app/src/main/java/org/simple/clinic/summary/PatientSummaryEvent.kt` change together 60% of the time (37 of the 62 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 37 shared commits counted here, the most recent 3 are `5c4bd282` Expand CDSS nudge and BP threshold support (#5916); `58b63c33` Add CVD Risk View to patient summary screen (#5848); `974340e3` Update tobacco use answer on dialog selection (#5542) — run `git show` on any of them.
  • Change coupling: MedicalHistoryQuestion.kt ↔ NewMedicalHistoryScreen.kt app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistoryQuestion.kt:1 — `app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistoryQuestion.kt` and `app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryScreen.kt` change together 53% of the time (8 of the 15 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `159617fa` Update UI to include Smokeless tobacco option in medical history ques…; `6414e228` Add Current smoker question to patient enrolment and summary screen f…; `d405faa9` Fix hypertension treatment question showing Sri Lanka translation in … — run `git show` on any of them.
  • Change coupling: PatientSummaryEffect.kt ↔ PatientSummaryUiActions.kt app/src/main/java/org/simple/clinic/summary/PatientSummaryEffect.kt:1 — `app/src/main/java/org/simple/clinic/summary/PatientSummaryEffect.kt` and `app/src/main/java/org/simple/clinic/summary/PatientSummaryUiActions.kt` change together 52% of the time (14 of the 27 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 14 shared commits counted here, the most recent 3 are `a4707c7a` Update smoking dialog to a multi-choice tobacco dialog (#5470); `f567bc55` Calculate and load lab-based statin info if lab based statin nudge fe…; `a92004c5` Add smoking and bmi buttons to statin nudge (#5163) — run `git show` on any of them.
  • Change coupling: OngoingMedicalHistoryEntry.kt ↔ NewMedicalHistoryScreen.kt app/src/main/java/org/simple/clinic/medicalhistory/OngoingMedicalHistoryEntry.kt:1 — `app/src/main/java/org/simple/clinic/medicalhistory/OngoingMedicalHistoryEntry.kt` and `app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryScreen.kt` change together 50% of the time (8 of the 16 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `159617fa` Update UI to include Smokeless tobacco option in medical history ques…; `6414e228` Add Current smoker question to patient enrolment and summary screen f…; `d405faa9` Fix hypertension treatment question showing Sri Lanka translation in … — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×7
  • Edited copy of a member (10 corresponding lines) app/src/main/java/org/simple/clinic/editpatient/EditPatientEffectHandler.kt:61 — app/src/main/java/org/simple/clinic/editpatient/EditPatientEffectHandler.kt:61-70 | app/src/main/java/org/simple/clinic/newentry/PatientEntryEffectHandler.kt:34-43 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionScreen.kt:258 — app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionScreen.kt:258-268 | app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/screen/TeleconsultRecordScreen.kt:128-137 — 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) app/src/main/java/org/simple/clinic/reassignpatient/ReassignPatientEffectHandler.kt:53 — app/src/main/java/org/simple/clinic/reassignpatient/ReassignPatientEffectHandler.kt:53-62 | app/src/main/java/org/simple/clinic/summary/assignedfacility/AssignedFacilityEffectHandler.kt:35-44 — 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) app/src/main/java/org/simple/clinic/bp/BloodPressureRepository.kt:120 — app/src/main/java/org/simple/clinic/bp/BloodPressureRepository.kt:120-130 | app/src/main/java/org/simple/clinic/patient/PatientRepository.kt:591-600 — 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) app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarRepository.kt:118 — app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarRepository.kt:118-127 | app/src/main/java/org/simple/clinic/questionnaireresponse/QuestionnaireResponseRepository.kt:53-63 — 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) app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskRepository.kt:24 — app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskRepository.kt:24-33 | app/src/main/java/org/simple/clinic/patientattribute/PatientAttributeRepository.kt:24-34 — 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) app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:399 — app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:399-408 | app/src/main/java/org/simple/clinic/summary/nextappointment/NextAppointmentEffectHandler.kt:32-41 — 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.
D3 · God Classes · ClassTooLong · ×6
  • ClassTooLong: PatientRepository app/src/main/java/org/simple/clinic/patient/PatientRepository.kt:47 — ClassTooLong — 587 significant lines (blank, comment-only and punctuation-only lines excluded), 69 methods. The bar is 400 significant lines; this is 187 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PatientSummaryUpdate app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:31 — ClassTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 132 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PatientSummaryScreen app/src/main/java/org/simple/clinic/summary/PatientSummaryScreen.kt:95 — ClassTooLong — 519 significant lines (blank, comment-only and punctuation-only lines excluded), 77 methods. The bar is 400 significant lines; this is 119 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.
  • ClassTooLong: EditPatientScreen app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:111 — ClassTooLong — 497 significant lines (blank, comment-only and punctuation-only lines excluded), 73 methods. The bar is 400 significant lines; this is 97 over it, 1.24× 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: PatientSummaryEffectHandler app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:55 — ClassTooLong — 466 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 66 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PatientEntryScreen app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt:88 — ClassTooLong — 429 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods. The bar is 400 significant lines; this is 29 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D3 · God Classes · FileTooLong · ×6
  • FileTooLong: patient/PatientRepository.kt app/src/main/java/org/simple/clinic/patient/PatientRepository.kt — FileTooLong — 630 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: PatientRepository (47-880). The bar is 500 significant lines; this is 130 over it, 1.26× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: summary/PatientSummaryScreen.kt app/src/main/java/org/simple/clinic/summary/PatientSummaryScreen.kt — FileTooLong — 611 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: PatientSummaryScreen (95-918). The bar is 500 significant lines; this is 111 over it, 1.22× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: editpatient/EditPatientScreen.kt app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt — FileTooLong — 605 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: EditPatientScreen (111-921). The bar is 500 significant lines; this is 105 over it, 1.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: summary/PatientSummaryUpdate.kt app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt — FileTooLong — 560 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: PatientSummaryUpdate (31-768). The bar is 500 significant lines; this is 60 over it, 1.12× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: summary/PatientSummaryEffectHandler.kt app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt — FileTooLong — 518 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: PatientSummaryEffectHandler (55-709). The bar is 500 significant lines; this is 18 over it, 1.04× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: newentry/PatientEntryScreen.kt app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt — FileTooLong — 514 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: PatientEntryScreen (88-750). The bar is 500 significant lines; this is 14 over it, 1.03× 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.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×6
  • Edited copy of a member (13 corresponding lines) app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistory.kt:100 — app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistory.kt:100-112 | app/src/main/java/org/simple/clinic/medicalhistory/OngoingMedicalHistoryEntry.kt:29-41 — 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) app/src/main/java/org/simple/clinic/bp/BloodPressureLevel.kt:46 — app/src/main/java/org/simple/clinic/bp/BloodPressureLevel.kt:46-58 | app/src/main/java/org/simple/clinic/bp/BloodPressureLevel.kt:60-72 — 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) app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchScreen.kt:187 — app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchScreen.kt:187-199 | app/src/main/java/org/simple/clinic/home/patients/PatientsTabScreen.kt:181-194 — 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) app/src/main/java/org/simple/clinic/registration/confirmpin/RegistrationConfirmPinScreen.kt:118 — app/src/main/java/org/simple/clinic/registration/confirmpin/RegistrationConfirmPinScreen.kt:118-132 | app/src/main/java/org/simple/clinic/registration/pin/RegistrationPinScreen.kt:109-121 — 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) app/src/main/java/org/simple/clinic/selectcountry/adapter/SelectableCountryItem.kt:25 — app/src/main/java/org/simple/clinic/selectcountry/adapter/SelectableCountryItem.kt:25-38 | app/src/main/java/org/simple/clinic/selectstate/SelectableStateItem.kt:23-35 — 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) app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEffectHandler.kt:82 — app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEffectHandler.kt:82-94 | app/src/main/java/org/simple/clinic/summary/medicalhistory/MedicalHistorySummaryEffectHandler.kt:36-48 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×6
  • Duplicated block (9 lines × 2) app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:816 — app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:816-824 | app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt:552-560 — 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 `app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:816` 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) app/src/main/java/org/simple/clinic/drugs/PrescriptionRepository.kt:110 — app/src/main/java/org/simple/clinic/drugs/PrescriptionRepository.kt:110-118 | app/src/main/java/org/simple/clinic/questionnaireresponse/QuestionnaireResponseRepository.kt:81-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `payloads` to `List<PrescribedDrugPayload>` in one and `List<QuestionnaireResponsePayload>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:176 — app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:176-184 | app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloader.kt:102-110 — before extracting anything, compare `app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt` and `app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloader.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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 `app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (9 lines × 2) app/src/main/java/org/simple/clinic/teleconsultlog/prescription/patientinfo/TeleconsultPatientInfoEffectHandler.kt:22 — app/src/main/java/org/simple/clinic/teleconsultlog/prescription/patientinfo/TeleconsultPatientInfoEffectHandler.kt:22-30 | app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionEffectHandler.kt:72-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUpdate.kt:146 — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUpdate.kt:146-154 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryUpdate.kt:146-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUpdate.kt:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `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 (9 lines × 2) app/src/main/java/org/simple/clinic/teleconsultlog/prescription/doctorinfo/TeleconsultDoctorInfoEffectHandler.kt:64 — app/src/main/java/org/simple/clinic/teleconsultlog/prescription/doctorinfo/TeleconsultDoctorInfoEffectHandler.kt:64-72 | app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionEffectHandler.kt:100-108 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×6
  • Duplicated block (7 lines × 2) app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarHistoryListItemPagingSource.kt:80 — app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarHistoryListItemPagingSource.kt:80-86 | app/src/main/java/org/simple/clinic/bp/BloodPressureHistoryListItemPagingSource.kt:85-91 — 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 `app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarHistoryListItemPagingSource.kt:80` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/org/simple/clinic/home/overdue/OverdueScreen.kt:209 — app/src/main/java/org/simple/clinic/home/overdue/OverdueScreen.kt:209-215 | app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchScreen.kt:355-361 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) app/src/main/java/org/simple/clinic/widgets/ItemAdapter.kt:25 — app/src/main/java/org/simple/clinic/widgets/ItemAdapter.kt:25-31 | app/src/main/java/org/simple/clinic/widgets/PagingItemAdapter_old.kt:21-27 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreen.kt:217 — app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreen.kt:217-224 | app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummaryView.kt:260-266 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/BloodSugarHistoryListItem.kt:119 — app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/BloodSugarHistoryListItem.kt:119-125 | app/src/main/java/org/simple/clinic/bp/history/adapter/BloodPressureHistoryListItem.kt:95-101 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) app/src/main/java/org/simple/clinic/teleconsultlog/prescription/TeleconsultPrescriptionInit.kt:9 — app/src/main/java/org/simple/clinic/teleconsultlog/prescription/TeleconsultPrescriptionInit.kt:9-15 | app/src/main/java/org/simple/clinic/teleconsultlog/prescription/patientinfo/TeleconsultPatientInfoInit.kt:9-16 — 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.
D17 · Explicit Debt · FixmeComment · ×5
  • FixmeComment app/src/test/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinScreenLogicTest.kt:61 — // FIXME 02-08-2019 : Fix tests with unexpected errors are passing even when stubs are not passed — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/org/simple/clinic/user/UserSession.kt:167 — // FIXME: Figure out a better way to add access tokens to network calls in a reactive fashion — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/org/simple/clinic/user/UserSession.kt:168 — // FIXME: Maybe add a separate RxCallAdapterFactory that lets us transform requests without interceptors? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt:245 — // FIXME This is temporally coupled to `scrollToFirstFieldWithError()`. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt:680 — // FIXME This is temporally coupled to the layout and changes whenever the order of the fields change. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×5
  • Edited copy of a member (12 corresponding lines) app/src/main/java/org/simple/clinic/home/patients/links/PatientsTabLinkEffectHandler.kt:34 — app/src/main/java/org/simple/clinic/home/patients/links/PatientsTabLinkEffectHandler.kt:34-45 | app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEffectHandler.kt:30-41 — 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) app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryUpdate.kt:47 — app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryUpdate.kt:47-58 | app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryUpdate.kt:69-81 — 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) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.kt:367 — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.kt:367-378 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntrySheet.kt:436-447 — 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) app/src/release/java/org/simple/clinic/remoteconfig/firebase/FirebaseRemoteConfigModule.kt:17 — app/src/release/java/org/simple/clinic/remoteconfig/firebase/FirebaseRemoteConfigModule.kt:17-28 | app/src/debug/java/org/simple/clinic/remoteconfig/firebase/FirebaseRemoteConfigModule.kt:16-27 — 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) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUpdate.kt:107 — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUpdate.kt:107-118 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryUpdate.kt:173-184 — 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 (19 corresponding lines) · ×5
  • Edited copy of a member (19 corresponding lines) app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:460 — app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:460-484 | app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt:345-363 — 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) app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffectHandler.kt:59 — app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffectHandler.kt:59-78 | app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffectHandler.kt:102-120 — 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) app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffectHandler.kt:65 — app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffectHandler.kt:65-83 | app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffectHandler.kt:149-167 — 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) app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEffectHandler.kt:64 — app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEffectHandler.kt:64-84 | app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEffectHandler.kt:86-104 — 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) app/src/main/java/org/simple/clinic/patient/PatientRepository.kt:358 — app/src/main/java/org/simple/clinic/patient/PatientRepository.kt:358-378 | app/src/main/java/org/simple/clinic/patient/sync/PatientPayload.kt:224-242 — 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 (14 corresponding lines) · ×5
  • Edited copy of a member (14 corresponding lines) app/src/main/java/org/simple/clinic/newentry/country/BangladeshInputFieldsProvider.kt:20 — app/src/main/java/org/simple/clinic/newentry/country/BangladeshInputFieldsProvider.kt:20-34 | app/src/main/java/org/simple/clinic/newentry/country/SriLankaInputFieldsProvider.kt:19-32 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/org/simple/clinic/newentry/country/EthiopiaInputFieldsProvider.kt:19 — app/src/main/java/org/simple/clinic/newentry/country/EthiopiaInputFieldsProvider.kt:19-32 | app/src/main/java/org/simple/clinic/newentry/country/IndiaInputFieldsProvider.kt:24-40 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryEffectHandler.kt:101 — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryEffectHandler.kt:101-114 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryEffectHandler.kt:139-154 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchUpdate.kt:71 — app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchUpdate.kt:71-84 | app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchUpdate.kt:96-109 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) app/src/main/java/org/simple/clinic/instantsearch/InstantSearchEffectHandler.kt:82 — app/src/main/java/org/simple/clinic/instantsearch/InstantSearchEffectHandler.kt:82-95 | app/src/main/java/org/simple/clinic/instantsearch/InstantSearchEffectHandler.kt:97-110 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×5
  • Edited copy of a member (16 corresponding lines) app/src/main/java/org/simple/clinic/drugs/selection/DrugListItem.kt:41 — app/src/main/java/org/simple/clinic/drugs/selection/DrugListItem.kt:41-57 | app/src/main/java/org/simple/clinic/drugs/selection/DrugListItem.kt:72-87 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUpdate.kt:77 — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUpdate.kt:77-92 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryUpdate.kt:116-131 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:576 — app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:576-591 | app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:865-880 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) app/src/main/java/org/simple/clinic/drugs/PrescriptionRepository.kt:209 — app/src/main/java/org/simple/clinic/drugs/PrescriptionRepository.kt:209-224 | app/src/main/java/org/simple/clinic/drugs/PrescriptionRepository.kt:230-246 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) app/src/main/java/org/simple/clinic/patientattribute/sync/PatientAttributeSync.kt:38 — app/src/main/java/org/simple/clinic/patientattribute/sync/PatientAttributeSync.kt:38-55 | app/src/main/java/org/simple/clinic/cvdrisk/sync/CVDRiskSync.kt:42-57 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×5
  • Edited copy of a member (15 corresponding lines) app/src/main/java/org/simple/clinic/summary/teleconsultation/messagebuilder/LongTeleconsultMessageBuilder.kt:150 — app/src/main/java/org/simple/clinic/summary/teleconsultation/messagebuilder/LongTeleconsultMessageBuilder.kt:150-164 | app/src/main/java/org/simple/clinic/summary/teleconsultation/messagebuilder/LongTeleconsultMessageBuilder.kt:169-183 — 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) app/src/main/java/org/simple/clinic/login/pin/LoginPinScreen.kt:106 — app/src/main/java/org/simple/clinic/login/pin/LoginPinScreen.kt:106-120 | app/src/main/java/org/simple/clinic/security/pin/verification/LoginPinServerVerificationMethod.kt:82-96 — 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) app/src/main/java/org/simple/clinic/drugs/search/DrugSearchEffectHandler.kt:43 — app/src/main/java/org/simple/clinic/drugs/search/DrugSearchEffectHandler.kt:43-57 | app/src/main/java/org/simple/clinic/recentpatient/AllRecentPatientsEffectHandler.kt:41-56 — 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) app/src/main/java/org/simple/clinic/summary/nextappointment/ui/NextAppointment.kt:189 — app/src/main/java/org/simple/clinic/summary/nextappointment/ui/NextAppointment.kt:189-203 | app/src/main/java/org/simple/clinic/summary/nextappointment/ui/NextAppointment.kt:207-221 — 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) app/src/main/java/org/simple/clinic/consent/onboarding/OnboardingConsentScreen.kt:65 — app/src/main/java/org/simple/clinic/consent/onboarding/OnboardingConsentScreen.kt:65-79 | app/src/main/java/org/simple/clinic/onboarding/OnboardingScreen.kt:74-90 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×4
  • Edited copy of a member (17 corresponding lines) app/src/main/java/org/simple/clinic/summary/compose/StatinNudgeDescription.kt:58 — app/src/main/java/org/simple/clinic/summary/compose/StatinNudgeDescription.kt:58-74 | app/src/main/java/org/simple/clinic/summary/compose/StatinNudgeDescription.kt:78-94 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) app/src/main/java/org/simple/clinic/editpatient/EditPatientEffectHandler.kt:291 — app/src/main/java/org/simple/clinic/editpatient/EditPatientEffectHandler.kt:291-307 | app/src/main/java/org/simple/clinic/editpatient/EditPatientEffectHandler.kt:311-330 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) app/src/main/java/org/simple/clinic/summary/updatephone/UpdatePhoneNumberEffectHandler.kt:47 — app/src/main/java/org/simple/clinic/summary/updatephone/UpdatePhoneNumberEffectHandler.kt:47-63 | app/src/main/java/org/simple/clinic/summary/updatephone/UpdatePhoneNumberEffectHandler.kt:65-81 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) app/src/main/java/org/simple/clinic/drugs/PrescribedDrug.kt:76 — app/src/main/java/org/simple/clinic/drugs/PrescribedDrug.kt:76-93 | app/src/main/java/org/simple/clinic/drugs/sync/PrescribedDrugPayload.kt:58-74 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×4
  • Edited copy of a member (11 corresponding lines) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.kt:355 — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.kt:355-365 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntrySheet.kt:424-434 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerValidator.kt:25 — app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerValidator.kt:25-37 | app/src/main/java/org/simple/clinic/widgets/ageanddateofbirth/UserInputDateValidator.kt:26-36 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:212 — app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:212-222 | app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloader.kt:138-148 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) app/src/main/java/org/simple/clinic/recentpatient/RecentPatientItem.kt:35 — app/src/main/java/org/simple/clinic/recentpatient/RecentPatientItem.kt:35-45 | app/src/main/java/org/simple/clinic/recentpatientsview/RecentPatientItem.kt:49-60 — 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) · ×4
  • Edited copy of a member (7 corresponding lines) app/src/main/java/org/simple/clinic/medicalhistory/SelectOngoingDiabetesTreatmentErrorDialog.kt:23 — app/src/main/java/org/simple/clinic/medicalhistory/SelectOngoingDiabetesTreatmentErrorDialog.kt:23-29 | app/src/main/java/org/simple/clinic/medicalhistory/SelectOngoingHypertensionTreatmentErrorDialog.kt:23-29 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/org/simple/clinic/summary/addphone/AddPhoneNumberEffectHandler.kt:35 — app/src/main/java/org/simple/clinic/summary/addphone/AddPhoneNumberEffectHandler.kt:35-41 | app/src/main/java/org/simple/clinic/summary/updatephone/UpdatePhoneNumberEffectHandler.kt:83-89 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummaryView.kt:227 — app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummaryView.kt:227-233 | app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummaryView.kt:215-221 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) app/src/main/java/org/simple/clinic/home/help/HelpScreen.kt:67 — app/src/main/java/org/simple/clinic/home/help/HelpScreen.kt:67-73 | app/src/main/java/org/simple/clinic/removeoverdueappointment/RemoveOverdueAppointmentScreen.kt:93-100 — 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 (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:505 — app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:505-519 | app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt:366-380 — 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.
  • Duplicated block (15 lines × 2) app/src/main/java/org/simple/clinic/home/overdue/compose/OverdueScreenView.kt:99 — app/src/main/java/org/simple/clinic/home/overdue/compose/OverdueScreenView.kt:99-113 | app/src/main/java/org/simple/clinic/home/overdue/compose/OverdueScreenView.kt:124-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/home/overdue/compose/OverdueScreenView.kt:99` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:192 — app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:192-206 | app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloader.kt:118-132 — before extracting anything, compare `app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt` and `app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloader.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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 (15 lines × 2) app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffectHandler.kt:66 — app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffectHandler.kt:66-80 | app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffectHandler.kt:150-164 — 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 `app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffectHandler.kt:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×3
  • Edited copy of a member (32 corresponding lines) app/src/main/java/org/simple/clinic/overdue/download/OverdueDownloadWorker.kt:167 — app/src/main/java/org/simple/clinic/overdue/download/OverdueDownloadWorker.kt:167-198 | app/src/main/java/org/simple/clinic/patient/download/PatientLinetListDownloadWorker.kt:170-201 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (32 corresponding lines) app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseBottomSheet.kt:110 — app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseBottomSheet.kt:110-141 | app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseScreen.kt:78-111 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (32 corresponding lines) app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummaryView.kt:146 — app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummaryView.kt:146-178 | app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummaryView.kt:156-187 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×3
  • Edited copy of a member (26 corresponding lines) app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarHistoryListItemPagingSource.kt:52 — app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarHistoryListItemPagingSource.kt:52-77 | app/src/main/java/org/simple/clinic/bp/BloodPressureHistoryListItemPagingSource.kt:55-80 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) app/src/main/java/org/simple/clinic/enterotp/EnterOtpScreen.kt:267 — app/src/main/java/org/simple/clinic/enterotp/EnterOtpScreen.kt:267-292 | app/src/main/java/org/simple/clinic/security/pin/PinEntryCardView.kt:209-234 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) common-ui/src/main/java/org/simple/clinic/common/ui/components/Button.kt:72 — common-ui/src/main/java/org/simple/clinic/common/ui/components/Button.kt:72-97 | common-ui/src/main/java/org/simple/clinic/common/ui/components/Button.kt:108-136 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 8+ corresponding lines) app/src/main/java/org/simple/clinic/bloodsugar/entry/confirmremovebloodsugar/ConfirmRemoveBloodSugarDialog.kt:62 — app/src/main/java/org/simple/clinic/bloodsugar/entry/confirmremovebloodsugar/ConfirmRemoveBloodSugarDialog.kt:62-69 | app/src/main/java/org/simple/clinic/bp/entry/confirmremovebloodpressure/ConfirmRemoveBloodPressureDialog.kt:72-82 | app/src/main/java/org/simple/clinic/login/applock/ConfirmResetPinDialog.kt:33-40 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryScreen.kt:82 — app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryScreen.kt:82-91 | app/src/main/java/org/simple/clinic/reassignpatient/ReassignPatientSheet.kt:82-89 | app/src/main/java/org/simple/clinic/summary/PatientSummaryScreen.kt:288-300 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) app/src/main/java/org/simple/clinic/home/help/HelpScreenEffectHandler.kt:43 — app/src/main/java/org/simple/clinic/home/help/HelpScreenEffectHandler.kt:43-50 | app/src/main/java/org/simple/clinic/home/report/ReportsEffectHandler.kt:19-26 | app/src/main/java/org/simple/clinic/settings/SettingsEffectHandler.kt:50-57 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) app/src/main/java/org/simple/clinic/enterotp/EnterOtpScreen.kt:270 — app/src/main/java/org/simple/clinic/enterotp/EnterOtpScreen.kt:270-285 | app/src/main/java/org/simple/clinic/security/pin/PinEntryCardView.kt:212-227 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/enterotp/EnterOtpScreen.kt:270` 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 (16 lines × 2) app/src/main/java/org/simple/clinic/main/TheActivity.kt:191 — app/src/main/java/org/simple/clinic/main/TheActivity.kt:191-206 | app/src/main/java/org/simple/clinic/registerorlogin/AuthenticationActivity.kt:85-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (16 lines × 2) app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:234 — app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:234-249 | app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloader.kt:170-185 — before extracting anything, compare `app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt` and `app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloader.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×3
  • Duplicated block (13 lines × 2) app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:465 — app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:465-477 | app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt:348-360 — 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 `app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:465` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinUiRenderer.kt:13 — app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinUiRenderer.kt:13-25 | app/src/main/java/org/simple/clinic/forgotpin/createnewpin/ForgotPinCreateNewUiRenderer.kt:15-27 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `model` to `ForgotPinConfirmPinModel` in one and `ForgotPinCreateNewModel` 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 (13 lines × 2) app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreenEffectHandler.kt:74 — app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreenEffectHandler.kt:74-86 | app/src/main/java/org/simple/clinic/bp/history/BloodPressureHistoryScreenEffectHandler.kt:90-102 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreenEffectHandler.kt:74` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×3
  • Duplicated block (9 lines × 3) app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseBottomSheet.kt:132 — app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseBottomSheet.kt:132-140 | app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseDialog.kt:104-112 | app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseScreen.kt:98-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseScreen.kt:108` calls `events`, `dispatchEvent` and `app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseDialog.kt:113` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.kt:245 — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.kt:245-253 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntrySheet.kt:311-319 | app/src/main/java/org/simple/clinic/patientattribute/entry/BMIEntrySheet.kt:129-137 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (9 lines × 3) app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarRepository.kt:90 — app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarRepository.kt:90-98 | app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskRepository.kt:72-80 | app/src/main/java/org/simple/clinic/patientattribute/PatientAttributeRepository.kt:66-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `payloads` to `List<BloodSugarMeasurementPayload>` in one and `List<CVDRiskPayload>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×3
  • Duplicated block (8 lines × 3) app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:149 — app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:149-156 | app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:198-205 | app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:260-267 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) app/src/main/java/org/simple/clinic/contactpatient/ContactPatientEffectHandler.kt:60 — app/src/main/java/org/simple/clinic/contactpatient/ContactPatientEffectHandler.kt:60-67 | app/src/main/java/org/simple/clinic/instantsearch/InstantSearchEffectHandler.kt:112-119 | app/src/main/java/org/simple/clinic/summary/medicalhistory/MedicalHistorySummaryEffectHandler.kt:50-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (8 lines × 3) app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryEffectHandler.kt:115 — app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryEffectHandler.kt:115-122 | app/src/main/java/org/simple/clinic/monthlyreports/form/QuestionnaireEntryEffectHandler.kt:43-50 | app/src/main/java/org/simple/clinic/monthlyreports/list/MonthlyReportsEffectHandler.kt:38-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×3
  • Duplicated block (10 lines × 2) app/src/main/java/org/simple/clinic/util/moshi/LocalDateMoshiAdapter.kt:15 — app/src/main/java/org/simple/clinic/util/moshi/LocalDateMoshiAdapter.kt:15-24 | app/src/main/java/org/simple/clinic/util/room/LocalDateRoomTypeConverter.kt:15-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:251 — app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:251-260 | app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloader.kt:187-196 — before extracting anything, compare `app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt` and `app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloader.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) app/src/main/java/org/simple/clinic/signature/SignatureEffectHandler.kt:30 — app/src/main/java/org/simple/clinic/signature/SignatureEffectHandler.kt:30-39 | app/src/main/java/org/simple/clinic/teleconsultlog/prescription/doctorinfo/TeleconsultDoctorInfoEffectHandler.kt:53-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · MethodTooLong · ×2
  • MethodTooLong: SimpleThemeKt.parseSimpleTypography common-ui/src/main/java/org/simple/clinic/common/ui/theme/SimpleTheme.kt:133 — MethodTooLong — parseSimpleTypography runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SettingsUIKt.SettingsList app/src/main/java/org/simple/clinic/settings/SettingsUI.kt:106 — MethodTooLong — SettingsList runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D35 · Change Coupling · Change-coupling hub · ×2
  • Change-coupling hub: LookupPatientOnline.kt → AppDatabase.kt, MedicalHistoryRepository.kt, RoomMigrationsModule.kt app/src/main/java/org/simple/clinic/patient/onlinelookup/api/LookupPatientOnline.kt — `app/src/main/java/org/simple/clinic/patient/onlinelookup/api/LookupPatientOnline.kt` changes together with 3 other files — `app/src/main/java/org/simple/clinic/AppDatabase.kt`, `app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistoryRepository.kt`, `app/src/main/java/org/simple/clinic/storage/migrations/RoomMigrationsModule.kt` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
  • Change-coupling hub: PatientSummaryUpdate.kt → PatientSummaryEffectHandler.kt, PatientSummaryInit.kt, StatinNudge.kt app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt — `app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt` changes together with 3 other files — `app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt`, `app/src/main/java/org/simple/clinic/summary/PatientSummaryInit.kt`, `app/src/main/java/org/simple/clinic/summary/compose/StatinNudge.kt` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 13+ corresponding lines) app/src/main/java/org/simple/clinic/appupdate/AppUpdateNotificationWorker.kt:165 — app/src/main/java/org/simple/clinic/appupdate/AppUpdateNotificationWorker.kt:165-177 | app/src/main/java/org/simple/clinic/appupdate/AppUpdateNotificationWorker.kt:188-201 | app/src/main/java/org/simple/clinic/drugstockreminders/DrugStockWorker.kt:126-139 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) app/src/main/java/org/simple/clinic/summary/PatientSummaryScreen.kt:691 — app/src/main/java/org/simple/clinic/summary/PatientSummaryScreen.kt:691-703 | app/src/main/java/org/simple/clinic/summary/PatientSummaryScreen.kt:705-717 | app/src/main/java/org/simple/clinic/summary/PatientSummaryScreen.kt:719-731 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×2
  • Edited copy of a member (18 corresponding lines) app/src/main/java/org/simple/clinic/overdue/download/OverdueDownloadWorker.kt:83 — app/src/main/java/org/simple/clinic/overdue/download/OverdueDownloadWorker.kt:83-100 | app/src/main/java/org/simple/clinic/patient/download/PatientLinetListDownloadWorker.kt:85-103 — 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.
  • Edited copy of a member (18 corresponding lines) app/src/main/java/org/simple/clinic/util/WindowInsetsExt.kt:50 — app/src/main/java/org/simple/clinic/util/WindowInsetsExt.kt:50-67 | app/src/main/java/org/simple/clinic/util/WindowInsetsExt.kt:72-89 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 10+ corresponding lines) app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateDialog.kt:160 — app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateDialog.kt:160-169 | app/src/main/java/org/simple/clinic/home/patients/PatientsTabScreen.kt:337-346 | app/src/main/java/org/simple/clinic/introvideoscreen/IntroVideoScreen.kt:97-106 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) app/src/main/java/org/simple/clinic/contactpatient/CreateReminderForAppointment.kt:31 — app/src/main/java/org/simple/clinic/contactpatient/CreateReminderForAppointment.kt:31-41 | app/src/main/java/org/simple/clinic/contactpatient/RecordPatientAgreedToVisit.kt:29-38 | app/src/main/java/org/simple/clinic/removeoverdueappointment/CancelAppointmentWithReason.kt:34-44 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×2
  • Edited copy of a member (5 corresponding lines) app/src/main/java/org/simple/clinic/summary/addphone/AddPhoneNumberEffectHandler.kt:28 — app/src/main/java/org/simple/clinic/summary/addphone/AddPhoneNumberEffectHandler.kt:28-33 | app/src/main/java/org/simple/clinic/bp/entry/confirmremovebloodpressure/ConfirmRemoveBloodPressureEffectHandler.kt:26-30 — 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) app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:166 — app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloader.kt:166-170 | app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloader.kt:92-96 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×2
  • Edited copy of a member (4 corresponding lines) app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreen.kt:186 — app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreen.kt:186-189 | app/src/main/java/org/simple/clinic/bp/history/BloodPressureHistoryScreen.kt:188-191 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryEffectHandler.kt:96 — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryEffectHandler.kt:96-99 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryEffectHandler.kt:93-96 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×2
  • Duplicated block (34 lines × 2) app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt:58 — app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt:58-91 | app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummary.kt:65-98 — before extracting anything, compare `app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt` and `app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummary.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 78 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 `app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt:58` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (34 lines × 2) app/src/main/java/org/simple/clinic/drugstockreminders/enterdrugstock/EnterDrugStockWebViewClient.kt:12 — app/src/main/java/org/simple/clinic/drugstockreminders/enterdrugstock/EnterDrugStockWebViewClient.kt:12-45 | app/src/main/java/org/simple/clinic/home/report/ReportsWebViewClient.kt:12-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:448 — app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:448-464 | app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:507-523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (17 lines × 2) app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummaryItem.kt:84 — app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummaryItem.kt:84-100 | app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummaryItem.kt:78-94 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `item` to `BloodPressureSummaryItem` in one and `BloodSugarSummaryItem` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×2
  • Duplicated block (8 lines × 4) app/src/main/java/org/simple/clinic/drugs/search/sync/DrugSync.kt:28 — app/src/main/java/org/simple/clinic/drugs/search/sync/DrugSync.kt:28-37 | app/src/main/java/org/simple/clinic/protocol/sync/ProtocolSync.kt:28-35 | app/src/main/java/org/simple/clinic/questionnaire/sync/QuestionnaireSync.kt:27-35 | app/src/main/java/org/simple/clinic/returnscore/sync/ReturnScoreSync.kt:26-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
  • Duplicated block (8 lines × 4) app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinEffectHandler.kt:72 — app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinEffectHandler.kt:72-79 | app/src/main/java/org/simple/clinic/forgotpin/createnewpin/ForgotPinCreateNewEffectHandler.kt:47-54 | app/src/main/java/org/simple/clinic/login/applock/AppLockEffectHandler.kt:62-69 | app/src/main/java/org/simple/clinic/summary/prescribeddrugs/DrugSummaryEffectHandler.kt:32-39 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×2
  • Duplicated block (6 lines × 2) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUpdate.kt:186 — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUpdate.kt:186-191 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryUpdate.kt:194-199 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/BloodSugarHistoryListItem.kt:132 — app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/BloodSugarHistoryListItem.kt:132-137 | app/src/main/java/org/simple/clinic/bp/history/adapter/BloodPressureHistoryListItem.kt:109-114 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/BloodSugarHistoryListItem.kt:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/BloodSugarHistoryListItem.kt:139` calls `SuppressLint` and `app/src/main/java/org/simple/clinic/bp/history/adapter/BloodPressureHistoryListItem.kt:116` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×2
  • Duplicated block (12 lines × 2) app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:521 — app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:521-532 | app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt:382-393 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) app/src/main/java/org/simple/clinic/enterotp/EnterOtpEffectHandler.kt:87 — app/src/main/java/org/simple/clinic/enterotp/EnterOtpEffectHandler.kt:87-98 | app/src/main/java/org/simple/clinic/main/TheActivityEffectHandler.kt:70-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×2
  • Duplicated block (11 lines × 2) app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreen.kt:197 — app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreen.kt:197-207 | app/src/main/java/org/simple/clinic/bp/history/BloodPressureHistoryScreen.kt:151-161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEffectHandler.kt:59 — app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEffectHandler.kt:59-69 | app/src/main/java/org/simple/clinic/summary/bloodsugar/BloodSugarSummaryViewEffectHandler.kt:67-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEffectHandler.kt:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D5 · Coupling · Off the main sequence · ×2
  • Off the main sequence: :simple-visuals — :simple-visuals: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: :simple-platform — :simple-platform: abstractness 0.08, instability 0.00, distance 0.92 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
D1 · Cyclomatic Complexity · PatientSummaryUpdate.dataForHandlingBackLoaded (cyclomatic 24) · ×1
  • PatientSummaryUpdate.dataForHandlingBackLoaded (cyclomatic 24) app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:620 — PatientSummaryUpdate.dataForHandlingBackLoaded has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: PatientSummaryUpdate.update (cyclomatic 44) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · PatientSummaryUpdate.dataForHandlingDoneClickLoaded (cyclomatic 21) · ×1
  • PatientSummaryUpdate.dataForHandlingDoneClickLoaded (cyclomatic 21) app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:570 — PatientSummaryUpdate.dataForHandlingDoneClickLoaded has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: PatientSummaryUpdate.update (cyclomatic 44) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (78 shared lines) · ×1
  • Near-duplicate member pair (78 shared lines) app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt:36 — app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt:36-126 | app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummary.kt:43-133 — These two members are variants of one another: 78 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:147 — app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:147-191 | app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:196-253 | app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:258-310 | app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:749-767 — 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 (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:581 — app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:581-618 | app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:631-674 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) app/src/main/java/org/simple/clinic/summary/assignedfacility/ui/AssignedFacility.kt:27 — app/src/main/java/org/simple/clinic/summary/assignedfacility/ui/AssignedFacility.kt:27-76 | app/src/main/java/org/simple/clinic/summary/nextappointment/ui/NextAppointment.kt:42-109 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:567 — app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:567-603 | app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:607-642 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:204 — app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:204-239 | app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:241-274 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×1
  • Edited copy of a member (23 corresponding lines) app/src/main/java/org/simple/clinic/overdue/download/OverdueDownloadWorker.kt:133 — app/src/main/java/org/simple/clinic/overdue/download/OverdueDownloadWorker.kt:133-155 | app/src/main/java/org/simple/clinic/patient/download/PatientLinetListDownloadWorker.kt:136-158 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 25+ corresponding lines) app/src/main/java/org/simple/clinic/bp/BloodPressureHistoryListItemPagingSource.kt:84 — app/src/main/java/org/simple/clinic/bp/BloodPressureHistoryListItemPagingSource.kt:84-115 | app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummaryView.kt:268-299 | app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummaryView.kt:268-292 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×1
  • Edited copy of a member (24 corresponding lines) app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:815 — app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:815-838 | app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt:551-574 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) app/src/main/java/org/simple/clinic/home/overdue/compose/OverdueScreenView.kt:92 — app/src/main/java/org/simple/clinic/home/overdue/compose/OverdueScreenView.kt:92-113 | app/src/main/java/org/simple/clinic/home/overdue/compose/OverdueScreenView.kt:117-138 — 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 (21 corresponding lines) · ×1
  • Edited copy of a member (21 corresponding lines) app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistory.kt:118 — app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistory.kt:118-138 | app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistoryRepository.kt:195-218 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) app/src/main/java/org/simple/clinic/monthlyreports/form/compose/QuestionnaireHeader.kt:18 — app/src/main/java/org/simple/clinic/monthlyreports/form/compose/QuestionnaireHeader.kt:18-31 | app/src/main/java/org/simple/clinic/monthlyreports/form/compose/QuestionnaireParagraph.kt:17-30 | app/src/main/java/org/simple/clinic/monthlyreports/form/compose/QuestionnaireSubHeader.kt:17-30 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 21+ corresponding lines) app/src/main/java/org/simple/clinic/summary/medicalhistory/ui/MedicalHistorySummary.kt:74 — app/src/main/java/org/simple/clinic/summary/medicalhistory/ui/MedicalHistorySummary.kt:74-94 | app/src/main/java/org/simple/clinic/summary/medicalhistory/ui/MedicalHistorySummary.kt:98-118 | app/src/main/java/org/simple/clinic/summary/medicalhistory/ui/MedicalHistorySummary.kt:122-142 | app/src/main/java/org/simple/clinic/summary/medicalhistory/ui/MedicalHistorySummary.kt:146-166 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 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, 14+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 14+ corresponding lines) common-ui/src/main/java/org/simple/clinic/common/ui/theme/SimpleTheme.kt:32 — common-ui/src/main/java/org/simple/clinic/common/ui/theme/SimpleTheme.kt:32-45 | common-ui/src/main/java/org/simple/clinic/common/ui/theme/SimpleTheme.kt:48-61 | common-ui/src/main/java/org/simple/clinic/common/ui/theme/SimpleTheme.kt:64-77 | common-ui/src/main/java/org/simple/clinic/common/ui/theme/SimpleTheme.kt:80-93 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) app/src/main/java/org/simple/clinic/appupdate/AppUpdateModule.kt:57 — app/src/main/java/org/simple/clinic/appupdate/AppUpdateModule.kt:57-65 | app/src/main/java/org/simple/clinic/appupdate/AppUpdateModule.kt:88-98 | app/src/main/java/org/simple/clinic/simplevideo/SimpleVideoModule.kt:21-38 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 18+ corresponding lines) app/src/main/java/org/simple/clinic/login/LoginUserWithOtp.kt:50 — app/src/main/java/org/simple/clinic/login/LoginUserWithOtp.kt:50-67 | app/src/main/java/org/simple/clinic/user/refreshuser/RefreshCurrentUser.kt:68-85 | app/src/main/java/org/simple/clinic/user/registeruser/RegisterUser.kt:85-102 | app/src/main/java/org/simple/clinic/user/resetpin/ResetUserPin.kt:61-78 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) app/src/main/java/org/simple/clinic/summary/assignedfacility/AssignedFacilityView.kt:73 — app/src/main/java/org/simple/clinic/summary/assignedfacility/AssignedFacilityView.kt:73-94 | app/src/main/java/org/simple/clinic/summary/nextappointment/NextAppointmentCardView.kt:102-125 | app/src/main/java/org/simple/clinic/summary/prescribeddrugs/DrugSummaryView.kt:118-142 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 7+ corresponding lines) app/src/main/java/org/simple/clinic/medicalhistory/SelectDiagnosisOrReferralRequiredErrorDialog.kt:23 — app/src/main/java/org/simple/clinic/medicalhistory/SelectDiagnosisOrReferralRequiredErrorDialog.kt:23-29 | app/src/main/java/org/simple/clinic/medicalhistory/SelectDiagnosisRequiredErrorDialog.kt:22-28 | app/src/main/java/org/simple/clinic/medicalhistory/SelectHypertensionDiagnosisOrReferralRequiredErrorDialog.kt:23-29 | app/src/main/java/org/simple/clinic/medicalhistory/SelectHypertensionDiagnosisRequiredErrorDialog.kt:23-29 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.kt:225 — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.kt:225-231 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntrySheet.kt:282-288 | app/src/main/java/org/simple/clinic/patientattribute/entry/BMIEntrySheet.kt:121-127 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 3+ corresponding lines) app/src/main/java/org/simple/clinic/bloodsugar/sync/BloodSugarSync.kt:28 — app/src/main/java/org/simple/clinic/bloodsugar/sync/BloodSugarSync.kt:28-30 | app/src/main/java/org/simple/clinic/cvdrisk/sync/CVDRiskSync.kt:29-33 | app/src/main/java/org/simple/clinic/drugs/sync/PrescriptionSync.kt:28-30 | app/src/main/java/org/simple/clinic/medicalhistory/sync/MedicalHistorySync.kt:28-30 | app/src/main/java/org/simple/clinic/overdue/AppointmentSync.kt:26-28 | app/src/main/java/org/simple/clinic/patient/sync/PatientSync.kt:29-31 | app/src/main/java/org/simple/clinic/patientattribute/sync/PatientAttributeSync.kt:29-31 | app/src/main/java/org/simple/clinic/questionnaireresponse/sync/QuestionnaireResponseSync.kt:28-30 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×1
  • Edited copy of a member (6 corresponding lines) app/src/main/java/org/simple/clinic/deeplink/DeepLinkActivity.kt:128 — app/src/main/java/org/simple/clinic/deeplink/DeepLinkActivity.kt:128-134 | app/src/main/java/org/simple/clinic/settings/SettingsScreen.kt:113-118 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (24 lines × 3) · ×1
  • Duplicated block (24 lines × 3) app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt:103 — app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt:103-126 | app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummary.kt:110-133 | app/src/main/java/org/simple/clinic/summary/prescribeddrugs/ui/DrugSummary.kt:101-124 — before extracting anything, compare `app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt` and `app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummary.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 78 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 `app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt:103` 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) app/src/main/java/org/simple/clinic/overdue/download/OverdueDownloadWorker.kt:168 — app/src/main/java/org/simple/clinic/overdue/download/OverdueDownloadWorker.kt:168-190 | app/src/main/java/org/simple/clinic/patient/download/PatientLinetListDownloadWorker.kt:171-193 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: `CSV` names `org.simple.clinic.overdue.download.OverdueListFileFormat.CSV` in one and `org.simple.clinic.patient.download.PatientLineListFileFormat.CSV` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistoryRepository.kt:26 — app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistoryRepository.kt:26-45 | app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistoryRepository.kt:70-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt:37 — app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt:37-56 | app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummary.kt:44-63 — before extracting anything, compare `app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt` and `app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummary.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 78 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 `app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummary.kt:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–19 lines × 3) · ×1
  • Duplicated block (17–19 lines × 3) app/src/main/java/org/simple/clinic/medicalhistory/ui/BMIContainer.kt:36 — app/src/main/java/org/simple/clinic/medicalhistory/ui/BMIContainer.kt:36-52 | app/src/main/java/org/simple/clinic/summary/assignedfacility/ui/AssignedFacility.kt:31-49 | app/src/main/java/org/simple/clinic/summary/nextappointment/ui/NextAppointment.kt:46-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/medicalhistory/ui/BMIContainer.kt:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×1
  • Duplicated block (17–19 lines × 2) app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:592 — app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:592-610 | app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:648-664 — 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 `app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:592` 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 (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummaryItem.kt:35 — app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummaryItem.kt:35-50 | app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummaryItem.kt:41-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/summary/bloodpressures/ui/BloodPressureSummaryItem.kt:35` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `item` to `BloodPressureSummaryItem` in one and `BloodSugarSummaryItem` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseBottomSheet.kt:116 — app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseBottomSheet.kt:116-128 | app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseDialog.kt:73-85 | app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseScreen.kt:84-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseBottomSheet.kt:116` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseBottomSheet.kt:130` calls `events`, `dispatchEvent` and `app/src/main/java/org/simple/clinic/navigation/v2/fragments/BaseScreen.kt:98` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) app/src/main/java/org/simple/clinic/medicalhistory/ui/BMIContainer.kt:94 — app/src/main/java/org/simple/clinic/medicalhistory/ui/BMIContainer.kt:94-104 | app/src/main/java/org/simple/clinic/summary/assignedfacility/ui/AssignedFacility.kt:66-76 | app/src/main/java/org/simple/clinic/summary/ui/CVDRiskView.kt:74-84 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/medicalhistory/ui/BMIContainer.kt:94` 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 (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffectHandler.kt:67 — app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffectHandler.kt:67-74 | app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffectHandler.kt:107-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffectHandler.kt:67` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffectHandler.kt:65` calls `softDeletePrescription`, `andThen`, `savePrescription` and `app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffectHandler.kt:107` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) app/src/main/java/org/simple/clinic/home/overdue/compose/OverdueUiModelMapper.kt:354 — app/src/main/java/org/simple/clinic/home/overdue/compose/OverdueUiModelMapper.kt:354-360 | app/src/main/java/org/simple/clinic/home/overdue/search/OverdueAppointmentSearchListItem.kt:69-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:148 — app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:148-153 | app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:197-202 | app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:259-264 | app/src/main/java/org/simple/clinic/summary/PatientSummaryUpdate.kt:750-755 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (17 lines × 7) · ×1
  • Duplicated block (17 lines × 7) app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurementType.kt:27 — app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurementType.kt:27-44 | app/src/main/java/org/simple/clinic/overdue/AppointmentCancelReason.kt:32-106 | app/src/main/java/org/simple/clinic/patient/PatientStatus.kt:46-64 | app/src/main/java/org/simple/clinic/questionnaire/QuestionnaireType.kt:26-43 | app/src/main/java/org/simple/clinic/questionnaire/component/properties/InputFieldType.kt:26-43 | app/src/main/java/org/simple/clinic/returnscore/ScoreType.kt:24-41 | app/src/main/java/org/simple/clinic/user/UserStatus.kt:37-53 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurementType.kt:27` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×1
  • Duplicated block (5 lines × 2) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.kt:392 — app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.kt:392-396 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntrySheet.kt:463-467 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (10 lines × 7) · ×1
  • Duplicated block (10 lines × 7) app/src/main/java/org/simple/clinic/bloodsugar/selection/type/BloodSugarTypePickerSheet.kt:66 — app/src/main/java/org/simple/clinic/bloodsugar/selection/type/BloodSugarTypePickerSheet.kt:66-75 | app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntrySheet.kt:223-232 | app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerSheet.kt:109-118 | app/src/main/java/org/simple/clinic/main/TheActivity.kt:226-235 | app/src/main/java/org/simple/clinic/registerorlogin/AuthenticationActivity.kt:102-111 | app/src/main/java/org/simple/clinic/setup/SetupActivity.kt:125-134 | app/src/main/java/org/simple/clinic/summary/teleconsultation/contactdoctor/ContactDoctorSheet.kt:161-170 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) app/src/main/java/org/simple/clinic/deeplink/DeepLinkActivity.kt:85 — app/src/main/java/org/simple/clinic/deeplink/DeepLinkActivity.kt:85-94 | app/src/main/java/org/simple/clinic/summary/teleconsultation/status/TeleconsultStatusSheet.kt:122-131 | app/src/main/java/org/simple/clinic/teleconsultlog/drugduration/DrugDurationSheet.kt:137-146 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinInit.kt:8 — app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinInit.kt:8-19 | app/src/main/java/org/simple/clinic/forgotpin/createnewpin/ForgotPinCreateNewInit.kt:10-23 | app/src/main/java/org/simple/clinic/login/applock/AppLockInit.kt:9-20 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
DM10 · One transaction, one aggregate · One operation mutates 3 aggregates · ×1
  • One operation mutates 3 aggregates: FakeDataGenerationReceiver.generateFakeData app/src/debug/java/org/simple/clinic/FakeDataGenerationReceiver.kt:86 — `FakeDataGenerationReceiver.generateFakeData` saves `PatientRepository`, `BloodPressureRepository`, `AppointmentRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
DM10 · One transaction, one aggregate · One operation mutates 2 aggregates · ×1
  • One operation mutates 2 aggregates: NewMedicalHistoryEffectHandler.registerPatient app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryEffectHandler.kt:56 — `NewMedicalHistoryEffectHandler.registerPatient` saves ``, `UUID` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
X3 · Exception handling · Swallowed exception (empty catch) · ×1
  • Swallowed exception (empty catch) app/src/main/java/org/simple/clinic/monthlyreports/form/compose/QuestionnaireInputField.kt:111 — 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.
Minor — 366 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×311
  • Orphaned file app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntrySheet.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.
  • Orphaned file app/src/main/java/org/simple/clinic/patient/Patient.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.
  • Orphaned file app/src/main/java/org/simple/clinic/contactpatient/ContactPatientBottomSheet.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.
  • Orphaned file app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntrySheet.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.
  • Orphaned file app/src/main/java/org/simple/clinic/navigation/v2/Router.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.
  • Orphaned file app/src/main/java/org/simple/clinic/editpatient/EditPatientEffectHandler.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.
  • Orphaned file app/src/main/java/org/simple/clinic/home/patients/PatientsTabScreen.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.
  • Orphaned file app/src/main/java/org/simple/clinic/instantsearch/InstantSearchScreen.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.
  • Orphaned file app/src/main/java/org/simple/clinic/AppDatabase.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.
  • Orphaned file app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdScreen.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.
  • Orphaned file app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchScreen.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.
  • Orphaned file app/src/main/java/org/simple/clinic/widgets/Views.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.
  • Orphaned file app/src/main/java/org/simple/clinic/settings/SettingsUI.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.
  • Orphaned file app/src/main/java/org/simple/clinic/overdue/Appointment.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.
  • Orphaned file app/src/main/java/org/simple/clinic/patient/OngoingNewPatientEntry.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.
  • Orphaned file app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentSheet.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.
  • Orphaned file app/src/main/java/org/simple/clinic/home/HomeScreen.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.
  • Orphaned file common-ui/src/main/java/org/simple/clinic/common/ui/theme/SimpleTheme.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.
  • Orphaned file app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryEffectHandler.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.
  • Orphaned file app/src/main/java/org/simple/clinic/summary/bloodsugar/ui/BloodSugarSummaryView.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.
  • Orphaned file app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionScreen.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.
  • Orphaned file app/src/main/java/org/simple/clinic/contactpatient/views/CallPatientView.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.
  • Orphaned file app/src/main/java/org/simple/clinic/main/TheActivity.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.
  • Orphaned file app/src/main/java/org/simple/clinic/widgets/PatientSearchResultItemView.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.
  • Orphaned file app/src/main/java/org/simple/clinic/drugs/PrescribedDrug.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.
  • + 286 more in this group — see findings.md.
AX6 · Interface segregation · Fat interface · ×15
  • Fat interface: AppDatabase (30 abstract methods) app/src/main/java/org/simple/clinic/AppDatabase.kt:156 — `AppDatabase` declares 30 abstract methods: `patientDao`, `addressDao`, `phoneNumberDao`, `patientSearchDao`, `bloodPressureDao`, `prescriptionDao`, `facilityDao`, `userDao`, `appointmentDao`, `overdueAppointmentDao`, `medicalHistoryDao`, `ongoingLoginEntryDao`, `protocolDao`, `protocolDrugDao`, `recentPatientDao`, `businessIdDao`, `missingPhoneReminderDao`, `bloodSugarDao`, `textRecordDao`, `teleconsultFacilityInfoDao`, `teleconsultMedicalOfficersDao`, `teleconsultFacilityWithMedicalOfficersDao`, `teleconsultRecordDao`, `drugDao`, `callResultDao`, `questionnaireDao`, `questionnaireResponseDao`, `patientAttributeDao`, `cvdRiskDao`, `returnScoreDao`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: RoomDao (22 abstract methods) app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:77 — `RoomDao` declares 22 abstract methods: `save`, `latestMeasurements`, `latestMeasurementsImmediate`, `allBloodSugars`, `allBloodSugarsImmediate`, `allBloodSugarsPagingSource`, `withSyncStatus`, `recordsWithSyncStatusBatched`, `updateSyncStatus`, `updateSyncStatusForIdsRaw`, `getOne`, `recordIdsWithSyncStatus`, `count`, `countWithStatus`, `recordedBloodSugarsCountForPatient`, `recordedBloodSugarsCountForPatientImmediate`, `haveBloodSugarsForPatientChangedSince`, `clear`, `purgeDeleted`, `getAllBloodSugarMeasurements`, `deleteWithoutLinkedPatient`, `purgeBloodSugarMeasurementWhenPatientIsNull`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: BloodSugarEntryUi (16 abstract methods) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUi.kt:8 — `BloodSugarEntryUi` declares 16 abstract methods: `showRemoveButton`, `hideRemoveButton`, `showEntryTitle`, `showEditTitle`, `showProgress`, `hideProgress`, `setBloodSugarUnitPreferenceLabelToMmol`, `setBloodSugarUnitPreferenceLabelToMg`, `showBloodSugarUnitPreferenceButton`, `hideBloodSugarUnitPreferenceButton`, `showBloodSugarUnitPreferenceLabel`, `hideBloodSugarUnitPreferenceLabel`, `decimalOrNumericBloodSugarInputType`, `numericBloodSugarInputType`, `setLabelForHbA1c`, `setLabelForUnknown`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: BloodSugarEntryUiActions (16 abstract methods) app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUiActions.kt:8 — `BloodSugarEntryUiActions` declares 16 abstract methods: `setBloodSugarReading`, `hideBloodSugarErrorMessage`, `hideDateErrorMessage`, `dismiss`, `showDateEntryScreen`, `setBloodSugarSavedResultAndFinish`, `showConfirmRemoveBloodSugarDialog`, `showBloodSugarUnitSelectionDialog`, `showBloodSugarEmptyError`, `showBloodSugarHighError`, `showBloodSugarLowError`, `showInvalidDateError`, `showDateIsInFutureError`, `showBloodSugarEntryScreen`, `showBloodSugarDate`, `setDateOnInputFields`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: RoomDao (27 abstract methods) app/src/main/java/org/simple/clinic/bp/BloodPressureMeasurement.kt:85 — `RoomDao` declares 27 abstract methods: `withSyncStatus`, `withSyncStatusBatched`, `updateSyncStatus`, `updateSyncStatusForIdsRaw`, `save`, `getOne`, `recordIdsWithStatus`, `bloodPressure`, `bloodPressureImmediate`, `count`, `countWithStatus`, `recordedBloodPressureCountForPatientImmediate`, `recordedBloodPressureCountForPatient`, `newestMeasurementsForPatient`, `newestMeasurementsForPatientImmediate`, `clearData`, `patientToFacilityIds`, `haveBpsForPatientChangedSince`, `allBloodPressures`, `hasBPRecordedToday`, `allBloodPressuresRecordedSinceImmediate`, `allBloodPressuresPagingSource`, `purgeDeleted`, `getAllBloodPressureMeasurements`, `deleteWithoutLinkedPatient`, `purgeBloodPressureMeasurementWhenPatientIsNull`, `isNewestBpEntryHigh`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: BloodPressureEntryUi (28 abstract methods) app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryUi.kt:7 — `BloodPressureEntryUi` declares 28 abstract methods: `changeFocusToDiastolic`, `changeFocusToSystolic`, `setBpSavedResultAndFinish`, `hideBpErrorMessage`, `showSystolicLessThanDiastolicError`, `showSystolicLowError`, `showSystolicHighError`, `showDiastolicLowError`, `showDiastolicHighError`, `showSystolicEmptyError`, `showDiastolicEmptyError`, `setSystolic`, `setDiastolic`, `showRemoveBpButton`, `hideRemoveBpButton`, `showEnterNewBloodPressureTitle`, `showEditBloodPressureTitle`, `showConfirmRemoveBloodPressureDialog`, `showBpEntryScreen`, `showDateEntryScreen`, `showInvalidDateError`, `showDateIsInFutureError`, `hideDateErrorMessage`, `setDateOnInputFields`, `showBpDate`, `dismiss`, `showProgress`, `hideProgress`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: ContactPatientUi (33 abstract methods) app/src/main/java/org/simple/clinic/contactpatient/ContactPatientUi.kt:6 — `ContactPatientUi` declares 33 abstract methods: `showProgress`, `hideProgress`, `switchToCallPatientView`, `switchToSetAppointmentReminderView`, `renderPatientDetails`, `showSecureCallUi`, `hideSecureCallUi`, `showNormalCallButtonText`, `showCallButtonText`, `showPatientWithNoPhoneNumberUi`, `hidePatientWithNoPhoneNumberUi`, `showPatientWithPhoneNumberUi`, `hidePatientWithPhoneNumberUi`, `setResultOfCallLabelText`, `setResultLabelText`, `setRegisterAtLabelText`, `setTransferredFromLabelText`, `showPatientWithPhoneNumberCallResults`, `hidePatientWithPhoneNumberCallResults`, `showPatientWithNoPhoneNumberResults`, `showDeadPatientStatus`, `hideDeadPatientStatus`, `renderSelectedAppointmentDate`, `disablePreviousReminderDateStepper`, `enablePreviousReminderDateStepper`, `disableNextReminderDateStepper`, `enableNextReminderDateStepper`, `showCallResult`, `hideCallResult`, `setupAgreedToVisitCallResultOutcome`, `setupRemindToCallLaterCallResultOutcome`, `setupRemovedFromListCallResultOutcome`, `setCallResultUpdatedAtDate`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: RoomDao (26 abstract methods) app/src/main/java/org/simple/clinic/drugs/PrescribedDrug.kt:133 — `RoomDao` declares 26 abstract methods: `withSyncStatus`, `withSyncStatusBatched`, `updateSyncStatus`, `updateSyncStatusForIdsRaw`, `save`, `softDelete`, `getOne`, `recordIdsWithSyncStatus`, `count`, `countWithStatus`, `forPatient`, `forPatientImmediate`, `clearData`, `prescription`, `prescriptionImmediate`, `hasPrescriptionForPatientChangedSince`, `hasPrescriptionForPatientChangedToday`, `purgeDeleted`, `updateDrugDuration`, `updateDrugFrequenecy`, `addTeleconsultationIdToDrugsRaw`, `softDeleteIdsRaw`, `getAllPrescribedDrugs`, `deleteWithoutLinkedPatient`, `purgePrescribedDrugWhenPatientIsNull`, `prescriptionCountImmediate`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: EditPatientUi (29 abstract methods) app/src/main/java/org/simple/clinic/editpatient/EditPatientUi.kt:9 — `EditPatientUi` declares 29 abstract methods: `displayBpPassports`, `setPatientName`, `setPatientPhoneNumber`, `setColonyOrVillage`, `setDistrict`, `setStreetAddress`, `setZone`, `setState`, `setGender`, `setPatientAge`, `setPatientDateOfBirth`, `setAlternateIdTextField`, `setAlternateIdContainer`, `showValidationErrors`, `hideValidationErrors`, `scrollToFirstFieldWithError`, `goBack`, `showDatePatternInDateOfBirthLabel`, `hideDatePatternInDateOfBirthLabel`, `setDateOfBirthAndAgeVisibility`, `showDiscardChangesAlert`, `showProgress`, `hideProgress`, `setupUi`, `setColonyOrVillagesAutoComplete`, `openSimpleScanIdScreen`, `showAddNHIDButton`, `hideAddNHIDButton`, `showIndiaNHIDLabel`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: RoomDao (18 abstract methods) app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistory.kt:141 — `RoomDao` declares 18 abstract methods: `recordsWithSyncStatus`, `recordsWithSyncStatusBatched`, `updateSyncStatus`, `updateSyncStatusForIdsRaw`, `getOne`, `recordIdsWithSyncStatus`, `save`, `saveHistories`, `count`, `countWithStatus`, `clear`, `historyForPatient`, `historyForPatientImmediate`, `hasMedicalHistoryForPatientChangedSinceImmediate`, `purgeDeleted`, `getAllMedicalHistories`, `deleteWithoutLinkedPatient`, `purgeMedicalHistoryWhenPatientIsNull`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: PatientEntryUiActions (18 abstract methods) app/src/main/java/org/simple/clinic/newentry/PatientEntryUiActions.kt:6 — `PatientEntryUiActions` declares 18 abstract methods: `prefillFields`, `scrollToFirstFieldWithError`, `scrollFormOnGenderSelection`, `setShowDatePatternInDateOfBirthLabel`, `openMedicalHistoryEntryScreen`, `showEmptyFullNameError`, `showLengthTooShortPhoneNumberError`, `showMissingGenderError`, `showEmptyColonyOrVillageError`, `showEmptyDistrictError`, `showEmptyStateError`, `showEmptyDateOfBirthAndAgeError`, `showInvalidDateOfBirthError`, `showDateOfBirthIsInFutureError`, `showAgeExceedsMaxLimitError`, `showDOBExceedsMaxLimitError`, `showAgeExceedsMinLimitError`, `showDOBExceedsMinLimitError`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: RoomDao (28 abstract methods) app/src/main/java/org/simple/clinic/overdue/Appointment.kt:164 — `RoomDao` declares 28 abstract methods: `recordsWithSyncStatus`, `recordsWithSyncStatusBatched`, `updateSyncStatus`, `updateSyncStatusForIdsRaw`, `getOne`, `recordIdsWithSyncStatus`, `save`, `lastCreatedAppointmentForPatient`, `count`, `countWithStatus`, `markOlderAppointmentsAsVisited`, `saveRemindDate`, `markAsAgreedToVisit`, `markAsVisited`, `cancelWithReason`, `clear`, `markAsVisitedForPatient`, `purgeDeleted`, `purgeUnusedAppointments`, `getAllAppointments`, `getAllAppointmentsForPatient`, `deleteWithoutLinkedPatient`, `purgeAppointmentsWhenPatientIsNull`, `latestOverdueAppointmentForPatient`, `nextAppointmentPatientProfile`, `hasAppointmentForPatientChangedSince`, `latestScheduledAppointmentForPatient`, `appointmentAndPatientInformationForIds`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: RoomDao (34 abstract methods) app/src/main/java/org/simple/clinic/patient/Patient.kt:85 — `RoomDao` declares 34 abstract methods: `allPatients`, `getOne`, `recordIdsWithSyncStatus`, `patient`, `patientImmediate`, `updateSyncStatus`, `updateSyncStatusForIdsRaw`, `patientCount`, `patientCountWithStatus`, `clear`, `findPatientsWithBusinessId`, `findPatientsWithBusinessIdImmediate`, `updatePatientStatus`, `compareAndUpdateRecordedAt`, `updateRecordedAt`, `deletePatient`, `updateAssignedFacilityId`, `recordsWithSyncStatus`, `patientProfile`, `patientProfileImmediate`, `allPatientProfiles`, `profilesWithSyncStatusBatched`, `isPatientDefaulter`, `hasPatientChangedSince`, `purgeDeleted`, `purgeDeletedPhoneNumbers`, `purgeDeletedBusinessIds`, `deletePatientsNotInFacilitiesRaw`, `purgePatientAfterRetentionTime`, `contactPatientProfileImmediate`, `villageAndPatientNamesInFacility`, `patientLineListRows`, `patientLineListCount`, `updatePatientReassignmentEligibilityStatus`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: PatientSummaryScreenUi (21 abstract methods) app/src/main/java/org/simple/clinic/summary/PatientSummaryScreenUi.kt:7 — `PatientSummaryScreenUi` declares 21 abstract methods: `renderPatientSummaryToolbar`, `populatePatientProfile`, `showDiabetesView`, `hideDiabetesView`, `showTeleconsultButton`, `hideTeleconsultButton`, `showAssignedFacilityView`, `hideAssignedFacilityView`, `hideDoneButton`, `showTeleconsultLogButton`, `hidePatientDiedStatus`, `showPatientDiedStatus`, `showNextAppointmentCard`, `hideNextAppointmentCard`, `showClinicalDecisionSupportAlert`, `hideClinicalDecisionSupportAlert`, `hideClinicalDecisionSupportAlertWithoutAnimation`, `updateStatinNudge`, `showBMIView`, `hideBMIView`, `updateCVDRiskView`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: PatientSummaryUiActions (26 abstract methods) app/src/main/java/org/simple/clinic/summary/PatientSummaryUiActions.kt:9 — `PatientSummaryUiActions` declares 26 abstract methods: `showScheduleAppointmentSheet`, `showEditPatientScreen`, `goToPreviousScreen`, `goToHomeScreen`, `showUpdatePhoneDialog`, `showAddPhoneDialog`, `showLinkIdWithPatientView`, `showDiagnosisRequiredError`, `showDiagnosisOrReferralRequiredError`, `showHypertensionDiagnosisRequiredError`, `showHypertensionDiagnosisOrReferralRequiredError`, `openPatientContactSheet`, `navigateToTeleconsultRecordScreen`, `openContactDoctorSheet`, `showAddMeasurementsWarningDialog`, `showAddBloodPressureWarningDialog`, `showAddBloodSugarWarningDialog`, `openSelectFacilitySheet`, `dispatchNewAssignedFacility`, `refreshNextAppointment`, `showReassignPatientWarningSheet`, `showDiabetesDiagnosisWarning`, `showHypertensionDiagnosisWarning`, `showTobaccoStatusDialog`, `openBMIEntrySheet`, `openCholesterolEntrySheet`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D21 · Naming Consistency · `patientUUID` spells `UUID` where 618 names in the project spell it `Uuid` · ×6
  • `patientUUID` spells `UUID` where 618 names in the project spell it `Uuid` app/src/main/java/org/simple/clinic/overdue/Appointment.kt:348 — 618 of 628 names in project app spell the token `Uuid` (618 of 628; unit: names in project app containing `Uuid`). Peers: BloodSugarMeasurement.patientUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:43); BloodSugarMeasurement.userUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:45); BloodSugarMeasurement.facilityUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:47); RoomDao.latestMeasurements(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:87); RoomDao.latestMeasurementsImmediate(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:94). Rename to `patientUuid`. [rule N6]
  • `patientUUID` spells `UUID` where 618 names in the project spell it `Uuid` app/src/main/java/org/simple/clinic/summary/PatientSummaryEffect.kt:68 — 618 of 628 names in project app spell the token `Uuid` (618 of 628; unit: names in project app containing `Uuid`). Peers: BloodSugarMeasurement.patientUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:43); BloodSugarMeasurement.userUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:45); BloodSugarMeasurement.facilityUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:47); RoomDao.latestMeasurements(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:87); RoomDao.latestMeasurementsImmediate(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:94). Rename to `patientUuid`. [rule N6]
  • `patientUUID` spells `UUID` where 618 names in the project spell it `Uuid` app/src/main/java/org/simple/clinic/summary/addcholesterol/CholesterolEntryModel.kt:11 — 618 of 628 names in project app spell the token `Uuid` (618 of 628; unit: names in project app containing `Uuid`). Peers: BloodSugarMeasurement.patientUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:43); BloodSugarMeasurement.userUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:45); BloodSugarMeasurement.facilityUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:47); RoomDao.latestMeasurements(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:87); RoomDao.latestMeasurementsImmediate(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:94). Rename to `patientUuid`. [rule N6]
  • `patientUUID` spells `UUID` where 618 names in the project spell it `Uuid` app/src/main/java/org/simple/clinic/summary/addcholesterol/CholesterolEntryModel.kt:17 — 618 of 628 names in project app spell the token `Uuid` (618 of 628; unit: names in project app containing `Uuid`). Peers: BloodSugarMeasurement.patientUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:43); BloodSugarMeasurement.userUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:45); BloodSugarMeasurement.facilityUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:47); RoomDao.latestMeasurements(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:87); RoomDao.latestMeasurementsImmediate(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:94). Rename to `patientUuid`. [rule N6]
  • `patientUUID` spells `UUID` where 618 names in the project spell it `Uuid` app/src/main/java/org/simple/clinic/summary/medicalhistory/MedicalHistorySummaryEffect.kt:8 — 618 of 628 names in project app spell the token `Uuid` (618 of 628; unit: names in project app containing `Uuid`). Peers: BloodSugarMeasurement.patientUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:43); BloodSugarMeasurement.userUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:45); BloodSugarMeasurement.facilityUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:47); RoomDao.latestMeasurements(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:87); RoomDao.latestMeasurementsImmediate(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:94). Rename to `patientUuid`. [rule N6]
  • `patientUUID` spells `UUID` where 618 names in the project spell it `Uuid` app/src/main/java/org/simple/clinic/summary/nextappointment/NextAppointmentUiActions.kt:6 — 618 of 628 names in project app spell the token `Uuid` (618 of 628; unit: names in project app containing `Uuid`). Peers: BloodSugarMeasurement.patientUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:43); BloodSugarMeasurement.userUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:45); BloodSugarMeasurement.facilityUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:47); RoomDao.latestMeasurements(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:87); RoomDao.latestMeasurementsImmediate(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:94). Rename to `patientUuid`. [rule N6]
D21 · Naming Consistency · `appointmentUUID` spells `UUID` where 618 names in the project spell it `Uuid` · ×3
  • `appointmentUUID` spells `UUID` where 618 names in the project spell it `Uuid` app/src/main/java/org/simple/clinic/overdue/Appointment.kt:233 — 618 of 628 names in project app spell the token `Uuid` (618 of 628; unit: names in project app containing `Uuid`). Peers: BloodSugarMeasurement.patientUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:43); BloodSugarMeasurement.userUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:45); BloodSugarMeasurement.facilityUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:47); RoomDao.latestMeasurements(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:87); RoomDao.latestMeasurementsImmediate(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:94). Rename to `appointmentUuid`. [rule N6]
  • `appointmentUUID` spells `UUID` where 618 names in the project spell it `Uuid` app/src/main/java/org/simple/clinic/overdue/Appointment.kt:245 — 618 of 628 names in project app spell the token `Uuid` (618 of 628; unit: names in project app containing `Uuid`). Peers: BloodSugarMeasurement.patientUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:43); BloodSugarMeasurement.userUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:45); BloodSugarMeasurement.facilityUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:47); RoomDao.latestMeasurements(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:87); RoomDao.latestMeasurementsImmediate(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:94). Rename to `appointmentUuid`. [rule N6]
  • `appointmentUUID` spells `UUID` where 618 names in the project spell it `Uuid` app/src/main/java/org/simple/clinic/overdue/callresult/CallResult.kt:156 — 618 of 628 names in project app spell the token `Uuid` (618 of 628; unit: names in project app containing `Uuid`). Peers: BloodSugarMeasurement.patientUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:43); BloodSugarMeasurement.userUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:45); BloodSugarMeasurement.facilityUuid (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:47); RoomDao.latestMeasurements(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:87); RoomDao.latestMeasurementsImmediate(patientUuid) (app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurement.kt:94). Rename to `appointmentUuid`. [rule N6]
D34 · Knowledge Freshness · Most significant orphaned file · ×3
  • Most significant orphaned file app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file app/src/main/java/org/simple/clinic/patient/PatientRepository.kt:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file app/src/main/java/org/simple/clinic/newentry/PatientEntryScreen.kt:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
D20 · ADR Quality · ADR has no Decision section · ×2
  • ADR has no Decision section doc/arch/002-bottom-sheets.md:1 — doc/arch/002-bottom-sheets.md has no Decision section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
  • ADR has no Decision section doc/arch/011-screen-navigation-v2.md:1 — doc/arch/011-screen-navigation-v2.md has no Decision section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D21 · Naming Consistency · `calculateCvdRisk` spells `Cvd` where 37 names in the project spell it `CVD` · ×2
  • `calculateCvdRisk` spells `Cvd` where 37 names in the project spell it `CVD` app/src/main/java/org/simple/clinic/cvdrisk/calculator/LabBasedCVDRiskCalculator.kt:18 — 37 of 39 names in project app spell the token `CVD` (37 of 39; unit: names in project app containing `CVD`). Peers: org.simple.clinic.cvdrisk.LabBasedCVDRiskCalculationSheet (app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskCalculationSheet.kt:8); org.simple.clinic.cvdrisk.NonLabBasedCVDRiskCalculationSheet (app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskCalculationSheet.kt:21); CVDRiskModule.nonLabBasedCVDRiskCalculationSheet (app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskModule.kt:41); CVDRiskModule.labBasedCVDRiskCalculationSheet (app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskModule.kt:55); CVDRiskRepository.getCVDRiskImmediate (app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskRepository.kt:82). Rename to `calculateCVDRisk`. [rule N6]
  • `calculateCvdRisk` spells `Cvd` where 37 names in the project spell it `CVD` app/src/main/java/org/simple/clinic/cvdrisk/calculator/NonLabBasedCVDRiskCalculator.kt:16 — 37 of 39 names in project app spell the token `CVD` (37 of 39; unit: names in project app containing `CVD`). Peers: org.simple.clinic.cvdrisk.LabBasedCVDRiskCalculationSheet (app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskCalculationSheet.kt:8); org.simple.clinic.cvdrisk.NonLabBasedCVDRiskCalculationSheet (app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskCalculationSheet.kt:21); CVDRiskModule.nonLabBasedCVDRiskCalculationSheet (app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskModule.kt:41); CVDRiskModule.labBasedCVDRiskCalculationSheet (app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskModule.kt:55); CVDRiskRepository.getCVDRiskImmediate (app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskRepository.kt:82). Rename to `calculateCVDRisk`. [rule N6]
X10 · Duplicated predicate · Duplicated predicate · ×2
  • Duplicated predicate app/src/main/java/org/simple/clinic/drugstockreminders/enterdrugstock/EnterDrugStockWebViewClient.kt:42 — `errorCode == ERROR_HOST_LOOKUP || errorCode == ERROR_CONNECT` appears character-identically in 2 files — app/src/main/java/org/simple/clinic/drugstockreminders/enterdrugstock/EnterDrugStockWebViewClient.kt, app/src/main/java/org/simple/clinic/home/report/ReportsWebViewClient.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 app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryViewModel.kt:23 — `features.isEnabled(Feature.NonLabBasedStatinNudge) || features.isEnabled(Feature.LabBasedStatinNudge)` appears character-identically in 2 files — app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryViewModel.kt, app/src/main/java/org/simple/clinic/summary/medicalhistory/MedicalHistorySummaryView.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.
C4 · Data Retention · Partial data-retention evidence · ×1
  • Partial data-retention evidence — A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a scheduled purge / cleanup job (a periodic worker or scheduled task that deletes rows past their retention — @Query("DELETE … WHERE createdAt < :cutoff"), deleteWhere { createdAt less cutoff }, purgeExpired… / deleteOld…).
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 10 significant file(s) lose their only recent owner: app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt, app/src/main/java/org/simple/clinic/summary/compose/StatinNudge.kt, app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistoryRepository.kt, app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffectHandler.kt, app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryScreen.kt, app/src/main/java/org/simple/clinic/bp/BloodPressureRepository.kt, app/src/main/java/org/simple/clinic/summary/PatientSummaryEffect.kt, app/src/main/java/org/simple/clinic/summary/PatientSummaryModel.kt (+2 more). Pair on, review, or document these before any departure.
D21 · Naming Consistency · `setupCallResultOutcomeUI` spells `UI` where 260 names in the project spell it `Ui` · ×1
  • `setupCallResultOutcomeUI` spells `UI` where 260 names in the project spell it `Ui` app/src/main/java/org/simple/clinic/contactpatient/ContactPatientUiRenderer.kt:53 — 260 of 264 names in project app spell the token `Ui` (260 of 264; unit: names in project app containing `Ui`). Peers: PlaceholderScreen.showLoadingUi (app/src/main/java/org/simple/clinic/activity/placeholder/PlaceholderScreen.kt:54); org.simple.clinic.appupdate.criticalupdatedialog.CriticalAppUpdateUi (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateUi.kt:5); org.simple.clinic.appupdate.criticalupdatedialog.CriticalAppUpdateUiRenderer (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateUiRenderer.kt:7); org.simple.clinic.bloodsugar.entry.BloodSugarEntryUi (app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUi.kt:8); org.simple.clinic.bloodsugar.entry.BloodSugarEntryUiActions (app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUiActions.kt:8). Rename to `setupCallResultOutcomeUi`. [rule N6]
D21 · Naming Consistency · `setUpUIForCreatingDrugEntry` spells `UI` where 260 names in the project spell it `Ui` · ×1
  • `setUpUIForCreatingDrugEntry` spells `UI` where 260 names in the project spell it `Ui` app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryUiRenderer.kt:59 — 260 of 264 names in project app spell the token `Ui` (260 of 264; unit: names in project app containing `Ui`). Peers: PlaceholderScreen.showLoadingUi (app/src/main/java/org/simple/clinic/activity/placeholder/PlaceholderScreen.kt:54); org.simple.clinic.appupdate.criticalupdatedialog.CriticalAppUpdateUi (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateUi.kt:5); org.simple.clinic.appupdate.criticalupdatedialog.CriticalAppUpdateUiRenderer (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateUiRenderer.kt:7); org.simple.clinic.bloodsugar.entry.BloodSugarEntryUi (app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUi.kt:8); org.simple.clinic.bloodsugar.entry.BloodSugarEntryUiActions (app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUiActions.kt:8). Rename to `setUpUiForCreatingDrugEntry`. [rule N6]
D21 · Naming Consistency · `setUpUIForUpdatingDrugEntry` spells `UI` where 260 names in the project spell it `Ui` · ×1
  • `setUpUIForUpdatingDrugEntry` spells `UI` where 260 names in the project spell it `Ui` app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryUiRenderer.kt:64 — 260 of 264 names in project app spell the token `Ui` (260 of 264; unit: names in project app containing `Ui`). Peers: PlaceholderScreen.showLoadingUi (app/src/main/java/org/simple/clinic/activity/placeholder/PlaceholderScreen.kt:54); org.simple.clinic.appupdate.criticalupdatedialog.CriticalAppUpdateUi (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateUi.kt:5); org.simple.clinic.appupdate.criticalupdatedialog.CriticalAppUpdateUiRenderer (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateUiRenderer.kt:7); org.simple.clinic.bloodsugar.entry.BloodSugarEntryUi (app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUi.kt:8); org.simple.clinic.bloodsugar.entry.BloodSugarEntryUiActions (app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUiActions.kt:8). Rename to `setUpUiForUpdatingDrugEntry`. [rule N6]
D21 · Naming Consistency · `drugStockFormURL` spells `URL` where 22 names in the project spell it `Url` · ×1
  • `drugStockFormURL` spells `URL` where 22 names in the project spell it `Url` app/src/main/java/org/simple/clinic/drugstockreminders/DrugStockReminderApiModule.kt:42 — 22 of 24 names in project app spell the token `Url` (22 of 24; unit: names in project app containing `Url`). Peers: NetworkAnalyticsInterceptor.sanitizeUrl (app/src/main/java/org/simple/clinic/analytics/NetworkAnalyticsInterceptor.kt:46); CriticalAppUpdateDialog.openContactUrl (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateDialog.kt:149); org.simple.clinic.appupdate.criticalupdatedialog.OpenHelpContactUrl (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateEffect.kt:9); OpenHelpContactUrl.contactUrl (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateEffect.kt:9); CriticalAppUpdateModel.contactUrl (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateModel.kt:29). Rename to `drugStockFormUrl`. [rule N6]
D21 · Naming Consistency · `ScanIndiaNationalHealthID` spells `ID` where 481 names in the project spell it `Id` · ×1
  • `ScanIndiaNationalHealthID` spells `ID` where 481 names in the project spell it `Id` app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:920 — 481 of 486 names in project app spell the token `Id` (481 of 486; unit: names in project app containing `Id`). Peers: AppDatabase.businessIdDao (app/src/main/java/org/simple/clinic/AppDatabase.kt:188); ClinicApp.updateAnalyticsUserId (app/src/main/java/org/simple/clinic/ClinicApp.kt:40); org.simple.clinic.analytics.UpdateAnalyticsUserId (app/src/main/java/org/simple/clinic/analytics/UpdateAnalyticsUserId.kt:15); UpdateAnalyticsUserId.statesToSetUserIdFor (app/src/main/java/org/simple/clinic/analytics/UpdateAnalyticsUserId.kt:20); New.patientId (app/src/main/java/org/simple/clinic/bloodsugar/entry/OpenAs.kt:14). Rename to `ScanIndiaNationalHealthId`. [rule N6]
D21 · Naming Consistency · `DrugStockFormURL` spells `URL` where 22 names in the project spell it `Url` · ×1
  • `DrugStockFormURL` spells `URL` where 22 names in the project spell it `Url` app/src/main/java/org/simple/clinic/main/TypedPreference.kt:20 — 22 of 24 names in project app spell the token `Url` (22 of 24; unit: names in project app containing `Url`). Peers: NetworkAnalyticsInterceptor.sanitizeUrl (app/src/main/java/org/simple/clinic/analytics/NetworkAnalyticsInterceptor.kt:46); CriticalAppUpdateDialog.openContactUrl (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateDialog.kt:149); org.simple.clinic.appupdate.criticalupdatedialog.OpenHelpContactUrl (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateEffect.kt:9); OpenHelpContactUrl.contactUrl (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateEffect.kt:9); CriticalAppUpdateModel.contactUrl (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateModel.kt:29). Rename to `DrugStockFormUrl`. [rule N6]
D21 · Naming Consistency · `appointmentID` spells `ID` where 481 names in the project spell it `Id` · ×1
  • `appointmentID` spells `ID` where 481 names in the project spell it `Id` app/src/main/java/org/simple/clinic/overdue/callresult/CallResultRepository.kt:53 — 481 of 486 names in project app spell the token `Id` (481 of 486; unit: names in project app containing `Id`). Peers: AppDatabase.businessIdDao (app/src/main/java/org/simple/clinic/AppDatabase.kt:188); ClinicApp.updateAnalyticsUserId (app/src/main/java/org/simple/clinic/ClinicApp.kt:40); org.simple.clinic.analytics.UpdateAnalyticsUserId (app/src/main/java/org/simple/clinic/analytics/UpdateAnalyticsUserId.kt:15); UpdateAnalyticsUserId.statesToSetUserIdFor (app/src/main/java/org/simple/clinic/analytics/UpdateAnalyticsUserId.kt:20); New.patientId (app/src/main/java/org/simple/clinic/bloodsugar/entry/OpenAs.kt:14). Rename to `appointmentId`. [rule N6]
D21 · Naming Consistency · `hasNationalHealthID` spells `ID` where 481 names in the project spell it `Id` · ×1
  • `hasNationalHealthID` spells `ID` where 481 names in the project spell it `Id` app/src/main/java/org/simple/clinic/patient/PatientProfile.kt:38 — 481 of 486 names in project app spell the token `Id` (481 of 486; unit: names in project app containing `Id`). Peers: AppDatabase.businessIdDao (app/src/main/java/org/simple/clinic/AppDatabase.kt:188); ClinicApp.updateAnalyticsUserId (app/src/main/java/org/simple/clinic/ClinicApp.kt:40); org.simple.clinic.analytics.UpdateAnalyticsUserId (app/src/main/java/org/simple/clinic/analytics/UpdateAnalyticsUserId.kt:15); UpdateAnalyticsUserId.statesToSetUserIdFor (app/src/main/java/org/simple/clinic/analytics/UpdateAnalyticsUserId.kt:20); New.patientId (app/src/main/java/org/simple/clinic/bloodsugar/entry/OpenAs.kt:14). Rename to `hasNationalHealthId`. [rule N6]
D21 · Naming Consistency · `isOpenedFromEditPatientScreenToAddNhid` spells `Nhid` where 30 names in the project spell it `NHID` · ×1
  • `isOpenedFromEditPatientScreenToAddNhid` spells `Nhid` where 30 names in the project spell it `NHID` app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdModel.kt:35 — 30 of 31 names in project app spell the token `NHID` (30 of 31; unit: names in project app containing `NHID`). Peers: org.simple.clinic.editpatient.AddNHIDButtonClicked (app/src/main/java/org/simple/clinic/editpatient/EditPatientEvent.kt:81); EditPatientModel.canAddNHID (app/src/main/java/org/simple/clinic/editpatient/EditPatientModel.kt:71); EditPatientScreen.addNHIDButton (app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:255); EditPatientScreen.showAddNHIDButton (app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:447); EditPatientScreen.hideAddNHIDButton (app/src/main/java/org/simple/clinic/editpatient/EditPatientScreen.kt:451). Rename to `isOpenedFromEditPatientScreenToAddNHID`. [rule N6]
D21 · Naming Consistency · `NationalHealthIDErrorDialog` spells `ID` where 481 names in the project spell it `Id` · ×1
  • `NationalHealthIDErrorDialog` spells `ID` where 481 names in the project spell it `Id` app/src/main/java/org/simple/clinic/scanid/scannedqrcode/NationalHealthIDErrorDialog.kt:10 — 481 of 486 names in project app spell the token `Id` (481 of 486; unit: names in project app containing `Id`). Peers: AppDatabase.businessIdDao (app/src/main/java/org/simple/clinic/AppDatabase.kt:188); ClinicApp.updateAnalyticsUserId (app/src/main/java/org/simple/clinic/ClinicApp.kt:40); org.simple.clinic.analytics.UpdateAnalyticsUserId (app/src/main/java/org/simple/clinic/analytics/UpdateAnalyticsUserId.kt:15); UpdateAnalyticsUserId.statesToSetUserIdFor (app/src/main/java/org/simple/clinic/analytics/UpdateAnalyticsUserId.kt:20); New.patientId (app/src/main/java/org/simple/clinic/bloodsugar/entry/OpenAs.kt:14). Rename to `NationalHealthIdErrorDialog`. [rule N6]
D21 · Naming Consistency · `SettingsUIKt` spells `UI` where 260 names in the project spell it `Ui` · ×1
  • `SettingsUIKt` spells `UI` where 260 names in the project spell it `Ui` app/src/main/java/org/simple/clinic/settings/SettingsUI.kt:1 — 260 of 264 names in project app spell the token `Ui` (260 of 264; unit: names in project app containing `Ui`). Peers: PlaceholderScreen.showLoadingUi (app/src/main/java/org/simple/clinic/activity/placeholder/PlaceholderScreen.kt:54); org.simple.clinic.appupdate.criticalupdatedialog.CriticalAppUpdateUi (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateUi.kt:5); org.simple.clinic.appupdate.criticalupdatedialog.CriticalAppUpdateUiRenderer (app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateUiRenderer.kt:7); org.simple.clinic.bloodsugar.entry.BloodSugarEntryUi (app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUi.kt:8); org.simple.clinic.bloodsugar.entry.BloodSugarEntryUiActions (app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryUiActions.kt:8). Rename to `SettingsUiKt`. [rule N6]
D21 · Naming Consistency · `loadBmiReading` spells `Bmi` where 33 names in the project spell it `BMI` · ×1
  • `loadBmiReading` spells `Bmi` where 33 names in the project spell it `BMI` app/src/main/java/org/simple/clinic/summary/PatientSummaryEffectHandler.kt:680 — 33 of 34 names in project app spell the token `BMI` (33 of 34; unit: names in project app containing `BMI`). Peers: NonLabBasedCVDRiskCalculator.getBMIRangeList (app/src/main/java/org/simple/clinic/cvdrisk/calculator/NonLabBasedCVDRiskCalculator.kt:44); NonLabBasedCVDRiskCalculator.getBMIRange (app/src/main/java/org/simple/clinic/cvdrisk/calculator/NonLabBasedCVDRiskCalculator.kt:49); org.simple.clinic.feature.Feature.ShowBMIContainer (app/src/main/java/org/simple/clinic/feature/Feature.kt:33); org.simple.clinic.medicalhistory.newentry.OpenBMIEntrySheet (app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryEffect.kt:38); org.simple.clinic.medicalhistory.newentry.AddOrEditBMIClicked (app/src/main/java/org/simple/clinic/medicalhistory/newentry/NewMedicalHistoryEvent.kt:45). Rename to `loadBMIReading`. [rule N6]
D21 · Naming Consistency · `loadMedicalRegistrationID` spells `ID` where 481 names in the project spell it `Id` · ×1
  • `loadMedicalRegistrationID` spells `ID` where 481 names in the project spell it `Id` app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionEffectHandler.kt:100 — 481 of 486 names in project app spell the token `Id` (481 of 486; unit: names in project app containing `Id`). Peers: AppDatabase.businessIdDao (app/src/main/java/org/simple/clinic/AppDatabase.kt:188); ClinicApp.updateAnalyticsUserId (app/src/main/java/org/simple/clinic/ClinicApp.kt:40); org.simple.clinic.analytics.UpdateAnalyticsUserId (app/src/main/java/org/simple/clinic/analytics/UpdateAnalyticsUserId.kt:15); UpdateAnalyticsUserId.statesToSetUserIdFor (app/src/main/java/org/simple/clinic/analytics/UpdateAnalyticsUserId.kt:20); New.patientId (app/src/main/java/org/simple/clinic/bloodsugar/entry/OpenAs.kt:14). Rename to `loadMedicalRegistrationId`. [rule N6]
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion app/build.gradle.kts:1 — `app` (85376 LoC, 4753 module-visible types across 260 directories) overshoots its size bounds. 1 of 8 build unit(s) (Gradle) overshoot their size bounds, lowering Project Cohesion to 7.5/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness · Concentrated knowledge decay · ×1
  • Concentrated knowledge decay — 314 of 389 significant files have no living knowledge, while the repository is still being changed at a low rate (18 commit(s) in the last 90 days) — so this is one repo-wide knowledge-decay state, not 314 separate risks. Counted over 389 of the 2004 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. The code moved on without the people who understood these files: document them or schedule a read-through before the next change lands in them.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:4 — No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 6 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.
PF1 · Benchmark discipline · Benchmarks don't track allocations · ×1
  • Benchmarks don't track allocations — A JMH/Jetpack Benchmark suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured.
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch app/src/main/java/org/simple/clinic/monthlyreports/util/StringFormatter.kt:13 — `getMonthlyReportFormattedMonthString` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Minor — 1 finding(s)
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: :common-ui — :common-ui: abstractness 0.07, instability 0.00, distance 0.93 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.

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-1b375fd6e59e4dd1b703f37ad6a2f005/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-1b375fd6e59e4dd1b703f37ad6a2f005/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-1b375fd6e59e4dd1b703f37ad6a2f005/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=7222" --report-format json --report-path /tmp/watchdog-gitleaks-1b375fd6e59e4dd1b703f37ad6a2f005/history-3.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-3.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-1b375fd6e59e4dd1b703f37ad6a2f005/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 .46artifacts/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) and a Gradle version catalogue — 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 9 file(s) — `app/src/main/java/org/simple/clinic/cvdrisk/CVDRiskCalculationSheet.kt`, `app/src/main/java/org/simple/clinic/drugs/selection/custom/drugfrequency/country/DrugFrequencyLabel.kt`, `app/src/main/java/org/simple/clinic/monthlyreports/form/compose/QuestionnaireInputField.kt`, `app/src/main/java/org/simple/clinic/patient/onlinelookup/api/SecondsDuration.kt`, `app/src/main/java/org/simple/clinic/scanid/IndiaNHIDDateOfBirth.kt`, … (+4 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) and a Gradle version catalogue — not scanned yet).0—

Run 01a1e713-a491-7906-b73d-30622513bbba · 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