Public report of pachi81/GlucoDataHandler, published 16 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 16 November 2026, 17:03 UTC · Survey ID cd_c9b06d70b898424bb9a2f5966f8a8ed0
pachi81/GlucoDataHandler
Measured 16 November 2026, 17:03 UTC, at code version 215b2f0
First survey, so nothing to compare with yet
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 37,376 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 0.2 person-years · Weakest lens: Production Readiness, 15.9
Findings by how serious they are
8 critical383 serious56 minor
13 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 17:03 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 ▸
46of 46 dimensions measured by tools.
436of 447 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.
46dimensions across 6 lenses, read from 37,376 lines of product code in 5 projects.
pachi81/GlucoDataHandler falls short of our standard for production because we found no working pipeline that builds or tests changes to the code and no logging, tracing or health checks in the code. It scores 43.3 out of 100 and is rated Weak, and none of its eight critical findings concern security.
Production Readiness, at 15.9, is the weakest lens and counts most in the score. The best first step for the work it takes is recording design decisions, worth about 5.4 points. Adding an automated build and test pipeline would lift Production Readiness itself, worth about 5.8 points. Raising Production Readiness to 70 would lift the score to about 64.8.
Eight sets of files in separate parts keep changing together, which points to hidden dependencies. Making the hidden dependencies explicit would close this risk.
The product code is 37,376 lines, about €33,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 forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 15.9 to 70, the lowest score rated Strong, the score would rise from 43.3 to about 64.8.
Code composition: what the lines of code are
Product code 97%Tests 3%
Rebuild cost: about €33,000 · Estimate
Cost to rebuild
€11,000 to €56,000, for 185 to 586 hours of work, about 0.2 person-years for one engineer
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 43. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 37,376 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle.
Raises the score by about 5.4 points · Low effort · ADR Quality
2
Add a CI workflow that builds and runs the test suite on every push/PR.
Raises the score by about 5.8 points · Medium effort · CI/CD gates
3
Adopt SLF4J (with a Logback or Log4j2 JSON encoder) and log at meaningful points in the modules you run.
Raises the score by about 5.8 points · Medium effort · Observability
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 €33,000 to build again, about 0.2 person-years of work. Its weakest lens is Production Readiness, at 15.9 (Critical). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No ADRs found finding(s) in ADR Quality. Of all the actions in this report, it raises the score most for the work it takes: about 5.4 points for low effort, because it clears the 1 ADR Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 10% on every change. The history of the code shows how much it changes: about 4,509 lines over the last 90 days, which is about 18,286 lines a year. At that pace, the extra work comes to an estimated 2.1 to 12.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
109 modules, with 92 dependencies between them. 2 loops run through 4 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 69 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.
glucodataauto.android_auto uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodataauto.android_auto, while a change to glucodataauto.android_auto can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodataauto.android_auto uses a module listed above it, which is the healthy direction.
glucodatahandler.PermanentNotification.StatusBarIcon uses glucodatahandler.PermanentNotification, so a change to glucodatahandler.PermanentNotification can break glucodatahandler.PermanentNotification.StatusBarIcon, while a change to glucodatahandler.PermanentNotification.StatusBarIcon can't break glucodatahandler.PermanentNotification.
Position
Below the diagonal: glucodatahandler.PermanentNotification.StatusBarIcon uses a module listed above it, which is the healthy direction.
glucodatahandler.android_auto uses glucodatahandler.android_auto.CarModeReceiver, so a change to glucodatahandler.android_auto.CarModeReceiver can break glucodatahandler.android_auto, while a change to glucodatahandler.android_auto can't break glucodatahandler.android_auto.CarModeReceiver.
Position
Below the diagonal: glucodatahandler.android_auto uses a module listed above it, which is the healthy direction.
glucodatahandler.common.WearPhoneConnection uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.common.WearPhoneConnection, while a change to glucodatahandler.common.WearPhoneConnection can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.common.WearPhoneConnection uses a module listed above it, which is the healthy direction.
glucodatahandler.common.chart uses glucodatahandler.common.database, so a change to glucodatahandler.common.database can break glucodatahandler.common.chart, while a change to glucodatahandler.common.chart can't break glucodatahandler.common.database.
Position
Below the diagonal: glucodatahandler.common.chart uses a module listed above it, which is the healthy direction.
glucodatahandler.common.chart uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.common.chart, while a change to glucodatahandler.common.chart can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.common.chart uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in glucodatahandler.common.chart.TimeValueFormatter uses a type in glucodatahandler.common.chart.TimeValueFormatter.Companion.
glucodatahandler.common.chart.TimeValueFormatter uses glucodatahandler.common.chart.TimeValueFormatter.Companion, so a change to glucodatahandler.common.chart.TimeValueFormatter.Companion can break glucodatahandler.common.chart.TimeValueFormatter, while a change to glucodatahandler.common.chart.TimeValueFormatter can't break glucodatahandler.common.chart.TimeValueFormatter.Companion.
Position
Below the diagonal: glucodatahandler.common.chart.TimeValueFormatter uses a module listed above it, which is the healthy direction.
12→20 glucodatahandler.common.notification.AlarmNotificationBase uses glucodatahandler.common.notificationpart of a loop✕
Connections
3 pairs of types, where a type in glucodatahandler.common.notification.AlarmNotificationBase uses a type in glucodatahandler.common.notification.
glucodatahandler.common.notification.AlarmNotificationBase uses glucodatahandler.common.notification, so a change to glucodatahandler.common.notification can break glucodatahandler.common.notification.AlarmNotificationBase, while a change to glucodatahandler.common.notification.AlarmNotificationBase can't break glucodatahandler.common.notification.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
glucodatahandler.common.preferences uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.common.preferences, while a change to glucodatahandler.common.preferences can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.common.preferences uses a module listed above it, which is the healthy direction.
glucodatahandler.common.receiver uses glucodatahandler.common.database, so a change to glucodatahandler.common.database can break glucodatahandler.common.receiver, while a change to glucodatahandler.common.receiver can't break glucodatahandler.common.database.
Position
Below the diagonal: glucodatahandler.common.receiver uses a module listed above it, which is the healthy direction.
glucodatahandler.common.receiver uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.common.receiver, while a change to glucodatahandler.common.receiver can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.common.receiver uses a module listed above it, which is the healthy direction.
glucodatahandler.common.ui uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.common.ui, while a change to glucodatahandler.common.ui can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.common.ui uses a module listed above it, which is the healthy direction.
glucodatahandler.healthconnect uses glucodatahandler.common.database, so a change to glucodatahandler.common.database can break glucodatahandler.healthconnect, while a change to glucodatahandler.healthconnect can't break glucodatahandler.common.database.
Position
Below the diagonal: glucodatahandler.healthconnect uses a module listed above it, which is the healthy direction.
glucodatahandler.healthconnect uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.healthconnect, while a change to glucodatahandler.healthconnect can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.healthconnect uses a module listed above it, which is the healthy direction.
glucodatahandler.widget uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.widget, while a change to glucodatahandler.widget can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.widget uses a module listed above it, which is the healthy direction.
17→30 glucodatahandler.widget uses glucodatahandlerpart of a loop✕
Connections
1 pair of types, where a type in glucodatahandler.widget uses a type in glucodatahandler.
glucodatahandler.widget uses glucodatahandler, so a change to glucodatahandler can break glucodatahandler.widget, while a change to glucodatahandler.widget can't break glucodatahandler.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
glucodataauto.android_auto.CarMediaBrowserService uses glucodataauto.android_auto, so a change to glucodataauto.android_auto can break glucodataauto.android_auto.CarMediaBrowserService, while a change to glucodataauto.android_auto.CarMediaBrowserService can't break glucodataauto.android_auto.
Position
Below the diagonal: glucodataauto.android_auto.CarMediaBrowserService uses a module listed above it, which is the healthy direction.
glucodataauto.receiver uses glucodatahandler.common.receiver, so a change to glucodatahandler.common.receiver can break glucodataauto.receiver, while a change to glucodataauto.receiver can't break glucodatahandler.common.receiver.
Position
Below the diagonal: glucodataauto.receiver uses a module listed above it, which is the healthy direction.
glucodatahandler.common.notification uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.common.notification, while a change to glucodatahandler.common.notification can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.common.notification uses a module listed above it, which is the healthy direction.
glucodatahandler.common.notification uses glucodatahandler.common.notification.AlarmNotificationBase, so a change to glucodatahandler.common.notification.AlarmNotificationBase can break glucodatahandler.common.notification, while a change to glucodatahandler.common.notification can't break glucodatahandler.common.notification.AlarmNotificationBase.
Position
Below the diagonal: glucodatahandler.common.notification uses a module listed above it, which is the healthy direction.
glucodataauto.GlucoDataServiceAuto uses glucodatahandler.common.receiver, so a change to glucodatahandler.common.receiver can break glucodataauto.GlucoDataServiceAuto, while a change to glucodataauto.GlucoDataServiceAuto can't break glucodatahandler.common.receiver.
Position
Below the diagonal: glucodataauto.GlucoDataServiceAuto uses a module listed above it, which is the healthy direction.
glucodataauto.GlucoDataServiceAuto uses glucodataauto.receiver, so a change to glucodataauto.receiver can break glucodataauto.GlucoDataServiceAuto, while a change to glucodataauto.GlucoDataServiceAuto can't break glucodataauto.receiver.
Position
Below the diagonal: glucodataauto.GlucoDataServiceAuto uses a module listed above it, which is the healthy direction.
glucodataauto.preferences uses glucodatahandler.common.preferences, so a change to glucodatahandler.common.preferences can break glucodataauto.preferences, while a change to glucodataauto.preferences can't break glucodatahandler.common.preferences.
Position
Below the diagonal: glucodataauto.preferences uses a module listed above it, which is the healthy direction.
glucodataauto.preferences uses glucodatahandler.common.notification, so a change to glucodatahandler.common.notification can break glucodataauto.preferences, while a change to glucodataauto.preferences can't break glucodatahandler.common.notification.
Position
Below the diagonal: glucodataauto.preferences uses a module listed above it, which is the healthy direction.
glucodatahandler.common uses glucodatahandler.common.database, so a change to glucodatahandler.common.database can break glucodatahandler.common, while a change to glucodatahandler.common can't break glucodatahandler.common.database.
Position
Below the diagonal: glucodatahandler.common uses a module listed above it, which is the healthy direction.
glucodatahandler.common uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.common, while a change to glucodatahandler.common can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.common uses a module listed above it, which is the healthy direction.
glucodatahandler.common uses glucodatahandler.common.receiver, so a change to glucodatahandler.common.receiver can break glucodatahandler.common, while a change to glucodatahandler.common can't break glucodatahandler.common.receiver.
Position
Below the diagonal: glucodatahandler.common uses a module listed above it, which is the healthy direction.
glucodatahandler.common uses glucodatahandler.common.notification, so a change to glucodatahandler.common.notification can break glucodatahandler.common, while a change to glucodatahandler.common can't break glucodatahandler.common.notification.
Position
Below the diagonal: glucodatahandler.common uses a module listed above it, which is the healthy direction.
glucodatahandler.common.utils uses glucodatahandler.common.database, so a change to glucodatahandler.common.database can break glucodatahandler.common.utils, while a change to glucodatahandler.common.utils can't break glucodatahandler.common.database.
Position
Below the diagonal: glucodatahandler.common.utils uses a module listed above it, which is the healthy direction.
glucodatahandler.common.utils uses glucodatahandler.common.notification, so a change to glucodatahandler.common.notification can break glucodatahandler.common.utils, while a change to glucodatahandler.common.utils can't break glucodatahandler.common.notification.
Position
Below the diagonal: glucodatahandler.common.utils uses a module listed above it, which is the healthy direction.
glucodatahandler.notification uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.notification, while a change to glucodatahandler.notification can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.notification uses a module listed above it, which is the healthy direction.
glucodatahandler.notification uses glucodatahandler.common.chart, so a change to glucodatahandler.common.chart can break glucodatahandler.notification, while a change to glucodatahandler.notification can't break glucodatahandler.common.chart.
Position
Below the diagonal: glucodatahandler.notification uses a module listed above it, which is the healthy direction.
glucodatahandler.notification uses glucodatahandler.common.notification, so a change to glucodatahandler.common.notification can break glucodatahandler.notification, while a change to glucodatahandler.notification can't break glucodatahandler.common.notification.
Position
Below the diagonal: glucodatahandler.notification uses a module listed above it, which is the healthy direction.
glucodatahandler.settings uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.settings, while a change to glucodatahandler.settings can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.settings uses a module listed above it, which is the healthy direction.
glucodatahandler.settings uses glucodatahandler.common.notification, so a change to glucodatahandler.common.notification can break glucodatahandler.settings, while a change to glucodatahandler.settings can't break glucodatahandler.common.notification.
Position
Below the diagonal: glucodatahandler.settings uses a module listed above it, which is the healthy direction.
glucodatahandler.watch uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.watch, while a change to glucodatahandler.watch can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.watch uses a module listed above it, which is the healthy direction.
glucodatahandler.watch uses glucodatahandler.common.notification, so a change to glucodatahandler.common.notification can break glucodatahandler.watch, while a change to glucodatahandler.watch can't break glucodatahandler.common.notification.
Position
Below the diagonal: glucodatahandler.watch uses a module listed above it, which is the healthy direction.
glucodataauto uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodataauto, while a change to glucodataauto can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodataauto uses a module listed above it, which is the healthy direction.
glucodataauto uses glucodatahandler.common.chart, so a change to glucodatahandler.common.chart can break glucodataauto, while a change to glucodataauto can't break glucodatahandler.common.chart.
Position
Below the diagonal: glucodataauto uses a module listed above it, which is the healthy direction.
glucodataauto uses glucodatahandler.common.utils, so a change to glucodatahandler.common.utils can break glucodataauto, while a change to glucodataauto can't break glucodatahandler.common.utils.
Position
Below the diagonal: glucodataauto uses a module listed above it, which is the healthy direction.
glucodataauto.preferences.SettingsFragmentClass uses glucodataauto.preferences, so a change to glucodataauto.preferences can break glucodataauto.preferences.SettingsFragmentClass, while a change to glucodataauto.preferences.SettingsFragmentClass can't break glucodataauto.preferences.
Position
Below the diagonal: glucodataauto.preferences.SettingsFragmentClass uses a module listed above it, which is the healthy direction.
glucodatahandler uses glucodatahandler.PermanentNotification, so a change to glucodatahandler.PermanentNotification can break glucodatahandler, while a change to glucodatahandler can't break glucodatahandler.PermanentNotification.
Position
Below the diagonal: glucodatahandler uses a module listed above it, which is the healthy direction.
glucodatahandler uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler, while a change to glucodatahandler can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler uses a module listed above it, which is the healthy direction.
glucodatahandler uses glucodatahandler.common.chart, so a change to glucodatahandler.common.chart can break glucodatahandler, while a change to glucodatahandler can't break glucodatahandler.common.chart.
Position
Below the diagonal: glucodatahandler uses a module listed above it, which is the healthy direction.
glucodatahandler uses glucodatahandler.common.receiver, so a change to glucodatahandler.common.receiver can break glucodatahandler, while a change to glucodatahandler can't break glucodatahandler.common.receiver.
Position
Below the diagonal: glucodatahandler uses a module listed above it, which is the healthy direction.
glucodatahandler uses glucodatahandler.widget, so a change to glucodatahandler.widget can break glucodatahandler, while a change to glucodatahandler can't break glucodatahandler.widget.
Position
Below the diagonal: glucodatahandler uses a module listed above it, which is the healthy direction.
glucodatahandler uses glucodatahandler.common.notification, so a change to glucodatahandler.common.notification can break glucodatahandler, while a change to glucodatahandler can't break glucodatahandler.common.notification.
Position
Below the diagonal: glucodatahandler uses a module listed above it, which is the healthy direction.
glucodatahandler uses glucodatahandler.common, so a change to glucodatahandler.common can break glucodatahandler, while a change to glucodatahandler can't break glucodatahandler.common.
Position
Below the diagonal: glucodatahandler uses a module listed above it, which is the healthy direction.
glucodatahandler.common.AppSource uses glucodatahandler.common, so a change to glucodatahandler.common can break glucodatahandler.common.AppSource, while a change to glucodatahandler.common.AppSource can't break glucodatahandler.common.
Position
Below the diagonal: glucodatahandler.common.AppSource uses a module listed above it, which is the healthy direction.
glucodatahandler.common.Command uses glucodatahandler.common, so a change to glucodatahandler.common can break glucodatahandler.common.Command, while a change to glucodatahandler.common.Command can't break glucodatahandler.common.
Position
Below the diagonal: glucodatahandler.common.Command uses a module listed above it, which is the healthy direction.
glucodatahandler.common.GlucoDataService uses glucodatahandler.common, so a change to glucodatahandler.common can break glucodatahandler.common.GlucoDataService, while a change to glucodatahandler.common.GlucoDataService can't break glucodatahandler.common.
Position
Below the diagonal: glucodatahandler.common.GlucoDataService uses a module listed above it, which is the healthy direction.
glucodatahandler.common.SourceState uses glucodatahandler.common, so a change to glucodatahandler.common can break glucodatahandler.common.SourceState, while a change to glucodatahandler.common.SourceState can't break glucodatahandler.common.
Position
Below the diagonal: glucodatahandler.common.SourceState uses a module listed above it, which is the healthy direction.
glucodatahandler.common.service uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.common.service, while a change to glucodatahandler.common.service can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.common.service uses a module listed above it, which is the healthy direction.
glucodatahandler.common.service uses glucodatahandler.common.receiver, so a change to glucodatahandler.common.receiver can break glucodatahandler.common.service, while a change to glucodatahandler.common.service can't break glucodatahandler.common.receiver.
Position
Below the diagonal: glucodatahandler.common.service uses a module listed above it, which is the healthy direction.
glucodatahandler.common.service uses glucodatahandler.common, so a change to glucodatahandler.common can break glucodatahandler.common.service, while a change to glucodatahandler.common.service can't break glucodatahandler.common.
Position
Below the diagonal: glucodatahandler.common.service uses a module listed above it, which is the healthy direction.
glucodatahandler.common.tasks uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.common.tasks, while a change to glucodatahandler.common.tasks can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.common.tasks uses a module listed above it, which is the healthy direction.
glucodatahandler.common.tasks uses glucodatahandler.common, so a change to glucodatahandler.common can break glucodatahandler.common.tasks, while a change to glucodatahandler.common.tasks can't break glucodatahandler.common.
Position
Below the diagonal: glucodatahandler.common.tasks uses a module listed above it, which is the healthy direction.
glucodatahandler.common.tasks uses glucodatahandler.common.utils, so a change to glucodatahandler.common.utils can break glucodatahandler.common.tasks, while a change to glucodatahandler.common.tasks can't break glucodatahandler.common.utils.
Position
Below the diagonal: glucodatahandler.common.tasks uses a module listed above it, which is the healthy direction.
glucodatahandler.preferences uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.preferences, while a change to glucodatahandler.preferences can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.preferences uses a module listed above it, which is the healthy direction.
glucodatahandler.preferences uses glucodatahandler.common.preferences, so a change to glucodatahandler.common.preferences can break glucodatahandler.preferences, while a change to glucodatahandler.preferences can't break glucodatahandler.common.preferences.
Position
Below the diagonal: glucodatahandler.preferences uses a module listed above it, which is the healthy direction.
glucodatahandler.preferences uses glucodatahandler.common.notification, so a change to glucodatahandler.common.notification can break glucodatahandler.preferences, while a change to glucodatahandler.preferences can't break glucodatahandler.common.notification.
Position
Below the diagonal: glucodatahandler.preferences uses a module listed above it, which is the healthy direction.
glucodatahandler.preferences uses glucodatahandler.common, so a change to glucodatahandler.common can break glucodatahandler.preferences, while a change to glucodatahandler.preferences can't break glucodatahandler.common.
Position
Below the diagonal: glucodatahandler.preferences uses a module listed above it, which is the healthy direction.
glucodatahandler.transfer uses glucodatahandler.common.database, so a change to glucodatahandler.common.database can break glucodatahandler.transfer, while a change to glucodatahandler.transfer can't break glucodatahandler.common.database.
Position
Below the diagonal: glucodatahandler.transfer uses a module listed above it, which is the healthy direction.
glucodatahandler.transfer uses glucodatahandler.common.notifier, so a change to glucodatahandler.common.notifier can break glucodatahandler.transfer, while a change to glucodatahandler.transfer can't break glucodatahandler.common.notifier.
Position
Below the diagonal: glucodatahandler.transfer uses a module listed above it, which is the healthy direction.
glucodatahandler.transfer uses glucodatahandler.common, so a change to glucodatahandler.common can break glucodatahandler.transfer, while a change to glucodatahandler.transfer can't break glucodatahandler.common.
Position
Below the diagonal: glucodatahandler.transfer uses a module listed above it, which is the healthy direction.
glucodatahandler.BatteryLevelType uses glucodatahandler, so a change to glucodatahandler can break glucodatahandler.BatteryLevelType, while a change to glucodatahandler.BatteryLevelType can't break glucodatahandler.
Position
Below the diagonal: glucodatahandler.BatteryLevelType uses a module listed above it, which is the healthy direction.
glucodatahandler.SettingsFragmentClass uses glucodatahandler, so a change to glucodatahandler can break glucodatahandler.SettingsFragmentClass, while a change to glucodatahandler.SettingsFragmentClass can't break glucodatahandler.
Position
Below the diagonal: glucodatahandler.SettingsFragmentClass uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 64.3 · Adequate · gated by D2 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
11
Medium
Roadmap
Top priorities: Add a CI workflow that builds and runs the test suite on every push/PR; Adopt SLF4J (with a Logback or Log4j2 JSON encoder) and log at meaningful points in the modules you run; Run what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle.
Run what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
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 — 8
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 — 383
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 — 56
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 13
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 46 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, 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 — 46 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 436 of 447 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.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 — 5 Maven/Gradle manifest(s) were read, stating a version for 67 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. 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 (common/build.gradle), 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. `common/src/main/java/de/michelinside/glucodatahandler/common/GlucoDataService.kt`, `common/src/main/java/de/michelinside/glucodatahandler/common/chart/TimeAxisRenderer.kt`, `common/src/main/java/de/michelinside/glucodatahandler/common/utils/AiDexCgmParser.kt`, `mobile/src/main/java/de/michelinside/glucodatahandler/transfer/NightscoutUploader.kt` 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 (auto). the Android app did not build — `./gradlew :auto:assembleDebug` exited 1: FAILURE: Build failed with an exception.
* Where:
Build file 'build.gradle' line: 10
* What went wrong:
A problem occurred evaluating root projec…; runtime evidence skipped (launch chosen because auto/build.gradle 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.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Kotlin is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Kotlin is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
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.
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.
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.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
37 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was JsonUtils.typedMapToBundle at 86. A further 3 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 ReceiveData.onSharedPreferenceChanged at 19 — they are counted neither in the figure above nor in this dimension's score. 2 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: common/src/main/java/de/michelinside/glucodatahandler/common/GlucoDataService.kt (GlucoDataService.onSharedPreferenceChanged at 16), mobile/src/main/java/de/michelinside/glucodatahandler/notification/PermanentNotification.kt (PermanentNotification.onSharedPreferenceChanged at 16). 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.
+ 32 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 60 down to 60 or less in Cyclomatic Complexity — start with JsonUtils.typedMapToBundle (cyclomatic 86). — Refactoring it lifts Cyclomatic Complexity from 6.2 to about 6.5/10.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 86 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 9 bodies over 60 down to 60 or less in Cognitive Complexity — start with JsonUtils.typedMapToBundle (cognitive 168), GlucoseDataReceiver.requestWebserverData (cognitive 142), WearPhoneConnection.onMessageReceived (cognitive 141). — 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 9 together lifts Cognitive Complexity from 3.4 to about 5.4/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.5 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 10 TooManyMethods finding(s) in God Classes — start with AlarmNotificationBase.kt, ReceiveData.kt, ChartCreator.kt. — One of this dimension's main actionable groups (10 warning-level).
Resolve the 9 FileTooLong finding(s) in God Classes — start with MainActivity.kt (2), ReceiveData.kt, AlarmNotificationBase.kt. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 8 MethodTooLong finding(s) in God Classes — start with SettingsMigrator.kt (2), JsonUtils.kt, WearPhoneConnection.kt. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
90 duplicated block group(s) detected. 12.2 % of the production lines (4,544 of 37,376) are in a reported copy. A further 96 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) · ×12common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:197
Edited copy of a member (13 corresponding lines) · ×11common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartCreator.kt:639
Edited copy of a member (12 corresponding lines) · ×8mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1102
+ 67 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 12 Edited copy of a member (9 corresponding lines) finding(s) in Code Duplication — start with BatteryLevelWidget.kt (2), SourceOfflineFragment.kt, SelectReceiverPreference.kt. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 11 Edited copy of a member (13 corresponding lines) finding(s) in Code Duplication — start with REDACTED (2), ChartCreator.kt, CarMediaBrowserService.kt. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 11 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with MainActivity.kt (2), BatteryLevelWidget.kt (2), SourceOfflineFragment.kt. — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
5 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; 1 module(s) off the main sequence, with abstractness counted on 4 of the 5 (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: :common
✓ On the Gold path — maintain.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 13 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 5 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure. A further 31 coordinate(s) are not published to Maven Central — another repository (Google's Maven hosts androidx), a SNAPSHOT, or a private artifact — so their licences are not readable from here and they are outside this verdict.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 3 Hotspot finding(s) in Churn × Complexity Hotspots — start with MainActivity.kt, ReceiveData.kt, SettingsMigrator.kt. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 Repeated repair finding(s) in Churn × Complexity Hotspots — start with SettingsFragmentBase.kt. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor5.2 / 10Adequate✓ 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.
75 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt. Counted over 156 of the 234 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
2 deducted task-comment markers across 37376 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 2 TodoComment finding(s) in Explicit Debt — start with GlucoseBaseWidget.kt, AlarmNotificationBase.kt. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 4 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
1 naming inconsistencies among 70 declarations measured against a convention their peers follow.
`sensorID` spells `ID` where 77 names in the project spell it `Id`common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:52
What to do
Resolve the 1 `sensorID` spells `ID` where 77 names in the project spell it `Id` finding(s) in Naming Consistency — start with ReceiveData.kt. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
2 of 4 build units (Gradle) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×2common/build.gradle:1
What to do
Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with build.gradle (2). — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
70 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
Resolve the 10 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (10). — One of this dimension's main actionable groups (10 warning-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
3 of 156 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidgetNotifier.kt. Counted over 156 of the 234 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 8 Boundary-crossing change coupling finding(s) in Change Coupling — start with Constants.kt (5), GlucoseStatistics.kt, ReceiveData.kt. — One of this dimension's main actionable groups (8 issue-level).
Resolve the 9 Change coupling finding(s) in Change Coupling — start with Constants.kt (2), GlucoseValueDao.kt, ChartCreator.kt. — One of this dimension's main actionable groups (9 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 4 platform declaration(s) and 72 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.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
`GlucoseValueDao` declares 24 abstract methods: `insertValue`, `insertValues`, `updateRate`, `getValues`, `getValue`, `getValuesByTime`, `getLastTopNValues`, `getValuesInRange`, `getLiveValues`, `getLiveValuesByTimeSpan`, `getLiveValuesByStartTime`, `getLastTimestamp`, `getFirstTimestamp`, `getCount`, `getCountByTime`, `getMaxValue`, `getMaxValueByTime`, `getAverageValue`, `getValuesInRangeCount`, `getPreviousValue`, `deleteValue`, `deleteValues`, `deleteOldValues`, `deleteAllValues`. 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. — common/src/main/java/de/michelinside/glucodatahandler/common/database/GlucoseValueDao.kt:10
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Do you agree with this assessment?
P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
What to do
Add a CI workflow that builds and runs the test suite on every push/PR.
Do you agree with this assessment?
P2 · Observability0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
No logging call was found in the 229 JVM production file(s) this check read across 4 module(s). Each was searched for its ecosystem's logging libraries (JVM: SLF4J, Log4j2, java.util.logging, Logback, kotlin-logging, scala-logging) and for a call on a receiver named `log`/`logger` (or ending in `Logger`/`_logger`) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read — this is 'no logging found by this walk', not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose.
What to do
Adopt SLF4J (with a Logback or Log4j2 JSON encoder) and log at meaningful points in the modules you run.
Add a health-check endpoint (Spring Boot Actuator's /actuator/health, or a /health route) so orchestrators and load balancers can probe liveness/readiness.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 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.
`auto/build.gradle` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — auto/build.gradle:104
What to do
Run what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — common/src/main/java/de/michelinside/glucodatahandler/common/utils/HttpRequest.kt:97
What to do
Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
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.
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.
This coroutine runs on a dispatcher's thread, and `Thread.sleep` blocks that thread: for the whole delay no other coroutine scheduled on it makes progress (on `Dispatchers.Main` the UI freezes) — the Kotlin form of blocking on a task. Use `delay(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a call that cannot be made suspending, move it off the dispatcher with `withContext(Dispatchers.IO) { … }`. (×2) — common/src/main/java/de/michelinside/glucodatahandler/common/receiver/GlucoseDataReceiver.kt:142, common/src/main/java/de/michelinside/glucodatahandler/common/receiver/GlucoseDataReceiver.kt:144
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.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. 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 `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document3.5 / 10Weak✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`NightscoutSourceTask.parsePebbleIobCob` is public and takes `jsonObject: JSONObject` from its caller, and it calls itself at line 51 with a piece of `jsonObject` — the function is not `tailrec`, so every call is a real frame — and nowhere in `NightscoutSourceTask.parsePebbleIobCob` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `NightscoutSourceTask.parsePebbleIobCob` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — common/src/main/java/de/michelinside/glucodatahandler/common/tasks/NightscoutSourceTask.kt:51
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
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.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×2) — REDACTED:321, REDACTED:545
`catch (exc: 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. — common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartBitmap.kt:144
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
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.
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.
~20.9 `!!` not-null assertions per 1k Kotlin product lines — 859 across the 41083 line(s) of the 225 Kotlin file(s) read (generated, test and sample code not counted). Densest: mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt (64), common/src/main/java/de/michelinside/glucodatahandler/common/tasks/LibreLinkSourceTask.kt (39), common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt (37). Each one tells the compiler to trust the author about null and becomes a `NullPointerException` the first time the author is wrong. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
Replace `!!` rather than adding to it: each is a run-time null check the compiler could not prove. Narrow the value with a null check, an early return or `?: return`, use `?.` / `?:` where absence is legitimate, `requireNotNull(x) { "why" }` / `checkNotNull` where a missing value is a contract breach worth a message, make the property non-nullable and set it in the constructor (or `by lazy`) instead of `lateinit` plus `!!`, or change the API so the null cannot arrive.
Do you agree with this assessment?
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.
Unscored — 1 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 38 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 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.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 67 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: this repository's Java imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Kotlin imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean.
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
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 :auto:assembleDebug` exited 1: FAILURE: Build failed with an exception.
* Where:
Build file 'build.gradle' line: 10
* What went wrong:
A problem occurred evaluating root projec…; runtime evidence skipped (launch chosen because auto/build.gradle 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.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no data at rest for these controls to protect.
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.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named column (email, first_name, date_of_birth, phone_number, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — ~1000 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 — 5 Maven/Gradle manifest(s) were read, stating a version for 67 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. 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 .java, .kt, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 4 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (51 value object(s))
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — no CI workflow found
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@Benchmark` in a Java, Kotlin or Scala file importing JMH or kotlinx-benchmark, Jetpack Benchmark's `measureRepeated` in a file importing androidx.benchmark, or JMH/kotlinx-benchmark/androidx.benchmark in a pom.xml, Gradle or sbt build, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
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.
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
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 applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Kotlin was read, and it logs through none that an assembled message defeats: Android's `Log` and Timber, java.util.logging and log4j-api-kotlin take one finished message (as log4net does in C#), or it makes no call through a named logger at all. Calls made through SLF4J, log4j 2 or kotlin-logging (`LoggerFactory.getLogger`, `KotlinLogging.logger {}`) would be judged.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Boundary-crossing change coupling: GlucoseStatistics.kt ↔ MainActivity.kt common/src/main/java/de/michelinside/glucodatahandler/common/utils/GlucoseStatistics.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/utils/GlucoseStatistics.kt` (context common) and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` (context mobile) sit in DIFFERENT parts of the tree yet change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `2858e786` mmol/mol support for GMI and Hba1c; `db57f1fa` TITR support; `64a31ebc` Add Hba1c statistic — run `git show` on any of them.
Boundary-crossing change coupling: Constants.kt ↔ ComplicationsTapActionActivity.kt common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt` (context common) and `wear/src/main/java/de/michelinside/glucodatahandler/settings/ComplicationsTapActionActivity.kt` (context wear) sit in DIFFERENT parts of the tree yet change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `e8cdd929` Complication Tap action: show graph; `85839861` Change default tap action, fix uncaught exception, fix notification c…; `c62f7a29` TTS values, small fixes — run `git show` on any of them.
Boundary-crossing change coupling: Constants.kt ↔ AlarmAdvancedFragment.kt common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt` (context common) and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmAdvancedFragment.kt` (context mobile) sit in DIFFERENT parts of the tree yet change together 64% of the time (7 of the 11 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `e35984e0` Alarm: refactor settings; `0121cab2` Alarm delay on phone; `6eef4307` Move fullscreen setting, add obsolete color setting — run `git show` on any of them.
Boundary-crossing change coupling: Constants.kt ↔ AlarmFragment.kt common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt` (context common) and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt` (context mobile) sit in DIFFERENT parts of the tree yet change together 54% of the time (15 of the 28 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `56727dd4` Inactive time for all alarms; `e35984e0` Alarm: refactor settings; `defa8e0d` Workaround for Samsung notification bug — run `git show` on any of them.
Boundary-crossing change coupling: Constants.kt ↔ AlarmNotificationWear.kt common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt` (context common) and `wear/src/main/java/de/michelinside/glucodatahandler/AlarmNotificationWear.kt` (context wear) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `fb7e5757` Wear: No alarm while charging; `c0b5ba05` Wear: No update while watch screen is off; `884dd5a2` Wear toggle alarm and fix alarm state — run `git show` on any of them.
Boundary-crossing change coupling: Constants.kt ↔ SettingsFragment.kt common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt` (context common) and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragment.kt` (context mobile) sit in DIFFERENT parts of the tree yet change together 52% of the time (22 of the 42 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 22 shared commits counted here, the most recent 3 are `c793b57e` GDH/GDA Second replace related names; `024219bf` Pref for color scheme; `73efd208` Update settings menu — run `git show` on any of them.
Boundary-crossing change coupling: ReceiveData.kt ↔ TaskerPlugin.kt common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt` (context common) and `mobile/src/main/java/de/michelinside/glucodatahandler/tasker/TaskerPlugin.kt` (context mobile) sit in DIFFERENT parts of the tree yet change together 50% of the time (10 of the 20 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `da56f185` GDA: add new alarms; `898dcda9` Add IOB/COB support for NS #114; `1f731c86` Move glucose fun to GlucoDataUtils — run `git show` on any of them.
Boundary-crossing change coupling: Dialogs.kt ↔ MainActivity.kt common/src/main/java/de/michelinside/glucodatahandler/common/ui/Dialogs.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/ui/Dialogs.kt` (context common) and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` (context mobile) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `a0d9e2bc` AOD policy changes; `dfa3f1a4` fix cancel of aod accept dialoag; `f63ce8ae` fix sensor start time — run `git show` on any of them.
Serious — 383 finding(s)
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×12
Edited copy of a member (9 corresponding lines) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:197— common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:197-206 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmAdvancedFragment.kt:71-79 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/ui/SelectReceiverPreference.kt:78— common/src/main/java/de/michelinside/glucodatahandler/common/ui/SelectReceiverPreference.kt:78-86 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/VibratePatternPreference.kt:57-65 — 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) wear/src/main/java/de/michelinside/glucodatahandler/complications/ChartComplication.kt:149— wear/src/main/java/de/michelinside/glucodatahandler/complications/ChartComplication.kt:149-161 | wear/src/main/java/de/michelinside/glucodatahandler/complications/BgValueComplicationService.kt:71-79 — 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) auto/src/main/java/de/michelinside/glucodataauto/preferences/HelpFragment.kt:13— auto/src/main/java/de/michelinside/glucodataauto/preferences/HelpFragment.kt:13-21 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:30-39 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/notification/LockscreenActivity.kt:235— mobile/src/main/java/de/michelinside/glucodatahandler/notification/LockscreenActivity.kt:235-243 | wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmTypeActivity.kt:188-197 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:126— mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:126-134 | mobile/src/main/java/de/michelinside/glucodatahandler/widget/GlucoseBaseWidget.kt:123-132 — 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) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileUpdater.kt:28— wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileUpdater.kt:28-37 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileUpdater.kt:33-41 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:136— mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:136-145 | mobile/src/main/java/de/michelinside/glucodatahandler/widget/GlucoseBaseWidget.kt:134-142 — 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) wear/src/main/java/de/michelinside/glucodatahandler/GlucoDataServiceWear.kt:148— wear/src/main/java/de/michelinside/glucodatahandler/GlucoDataServiceWear.kt:148-157 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/TransferFragments.kt:197-205 — 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) wear/src/main/java/de/michelinside/glucodatahandler/complications/BgValueComplicationService.kt:48— wear/src/main/java/de/michelinside/glucodatahandler/complications/BgValueComplicationService.kt:48-56 | wear/src/main/java/de/michelinside/glucodatahandler/complications/ChartComplication.kt:139-147 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/GlucoDataServiceMobile.kt:44— mobile/src/main/java/de/michelinside/glucodatahandler/GlucoDataServiceMobile.kt:44-53 | wear/src/main/java/de/michelinside/glucodatahandler/GlucoDataServiceWear.kt:31-39 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/tasker/TaskerPlugin.kt:98— mobile/src/main/java/de/michelinside/glucodatahandler/tasker/TaskerPlugin.kt:98-106 | mobile/src/main/java/de/michelinside/glucodatahandler/tasker/WatchBatteryEvent.kt:67-75 — 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 (13 corresponding lines) · ×11
Edited copy of a member (13 corresponding lines) common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartCreator.kt:639— common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartCreator.kt:639-651 | common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartCreator.kt:661-673 — 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) auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarMediaBrowserService.kt:543— auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarMediaBrowserService.kt:543-555 | auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarMediaBrowserService.kt:564-576 — 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) REDACTED:247— REDACTED:247-259 | REDACTED:262-274 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt:99— common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt:99-113 | mobile/src/main/java/de/michelinside/glucodatahandler/watch/WatchDrip.kt:53-65 — 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) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:73— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:73-85 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:83-100 — 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) REDACTED:327— REDACTED:327-343 | REDACTED:412-424 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/chart/GlucoseChart.kt:69— common/src/main/java/de/michelinside/glucodatahandler/common/chart/GlucoseChart.kt:69-81 | common/src/main/java/de/michelinside/glucodatahandler/common/chart/GlucoseChart.kt:83-95 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:23— common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:23-36 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:33-45 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/VibratePatternPreferenceDialogFragmentCompat.kt:75— mobile/src/main/java/de/michelinside/glucodatahandler/preferences/VibratePatternPreferenceDialogFragmentCompat.kt:75-87 | wear/src/main/java/de/michelinside/glucodatahandler/settings/VibrationPatternActivity.kt:89-101 — 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) wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmAdvancedActivity.kt:184— wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmAdvancedActivity.kt:184-196 | wear/src/main/java/de/michelinside/glucodatahandler/settings/SettingsActivity.kt:225-238 — 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) wear/src/main/java/de/michelinside/glucodatahandler/complications/SmallImageComplication.kt:119— wear/src/main/java/de/michelinside/glucodatahandler/complications/SmallImageComplication.kt:119-131 | wear/src/main/java/de/michelinside/glucodatahandler/complications/SmallImageComplication.kt:147-159 — 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.
Duplicated block (7 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:264— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:264-270 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:343-349 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 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 `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:264` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:56— common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:56-62 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:89-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/notification/AlarmNotification.kt:94— mobile/src/main/java/de/michelinside/glucodatahandler/notification/AlarmNotification.kt:94-100 | mobile/src/main/java/de/michelinside/glucodatahandler/widget/GlucoseBaseWidget.kt:218-224 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:109— mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:109-115 | mobile/src/main/java/de/michelinside/glucodatahandler/widget/GlucoseBaseWidget.kt:106-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (7 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:641— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:641-647 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:556-562 — 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 `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:641` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:118— mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:118-124 | mobile/src/main/java/de/michelinside/glucodatahandler/widget/GlucoseBaseWidget.kt:115-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:320— common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:320-326 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt:185-191 — 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) wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmAdvancedActivity.kt:198— wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmAdvancedActivity.kt:198-204 | wear/src/main/java/de/michelinside/glucodatahandler/settings/SettingsActivity.kt:240-246 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:70— wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:70-76 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:73-79 — before extracting anything, compare `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) REDACTED:249— REDACTED:249-255 | REDACTED:264-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:249` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) common/src/main/java/de/michelinside/glucodatahandler/common/utils/JsonUtils.kt:109— common/src/main/java/de/michelinside/glucodatahandler/common/utils/JsonUtils.kt:109-115 | common/src/main/java/de/michelinside/glucodatahandler/common/utils/JsonUtils.kt:117-123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `common/src/main/java/de/michelinside/glucodatahandler/common/utils/JsonUtils.kt:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
TooManyMethods: AlarmNotificationBase common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:40— 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: ReceiveData common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:27— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ChartCreator common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartCreator.kt:45— 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: NotificationReceiver common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NotificationReceiver.kt:31— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Utils REDACTED:47— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BgValueComplicationService wear/src/main/java/de/michelinside/glucodatahandler/complications/BgValueComplicationService.kt:21— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MainActivity mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:97— 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: DataSourceTask common/src/main/java/de/michelinside/glucodatahandler/common/tasks/DataSourceTask.kt:30— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WearPhoneConnection common/src/main/java/de/michelinside/glucodatahandler/common/WearPhoneConnection.kt:42— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: dbAccess common/src/main/java/de/michelinside/glucodatahandler/common/database/dbAccess.kt:38— 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.
FileTooLong: glucodatahandler/MainActivity.kt mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt— FileTooLong — 1090 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: MainActivity (97-1441). The bar is 500 significant lines; this is 590 over it, 2.18× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: common/ReceiveData.kt common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt— FileTooLong — 868 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 368 over it, 1.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: notification/AlarmNotificationBase.kt common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt— FileTooLong — 839 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: AlarmNotificationBase (40-1136). The bar is 500 significant lines; this is 339 over it, 1.68× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: chart/ChartCreator.kt common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartCreator.kt— FileTooLong — 651 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 151 over it, 1.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: common/WearPhoneConnection.kt common/src/main/java/de/michelinside/glucodatahandler/common/WearPhoneConnection.kt— FileTooLong — 640 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: WearPhoneConnection (42-890). The bar is 500 significant lines; this is 140 over it, 1.28× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: receiver/NotificationReceiver.kt common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NotificationReceiver.kt— FileTooLong — 640 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 140 over it, 1.28× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: glucodataauto/MainActivity.kt auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt— FileTooLong — 554 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: MainActivity (63-736). The bar is 500 significant lines; this is 54 over it, 1.11× 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: REDACTED REDACTED— FileTooLong — 524 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 24 over it, 1.05× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: notification/AlarmHandler.kt common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt— FileTooLong — 503 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3 over it, 1.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Change coupling: GlucoseValueDao.kt ↔ dbAccess.kt common/src/main/java/de/michelinside/glucodatahandler/common/database/GlucoseValueDao.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/database/GlucoseValueDao.kt` and `common/src/main/java/de/michelinside/glucodatahandler/common/database/dbAccess.kt` change together 90% of the time (9 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `6dc6db71` Fix db-trend; `bdb9f946` Add trend to marker; `75aabb66` Fix nightscout upload — run `git show` on any of them.
Change coupling: ChartCreator.kt ↔ GlucoseValueDao.kt common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartCreator.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartCreator.kt` and `common/src/main/java/de/michelinside/glucodatahandler/common/database/GlucoseValueDao.kt` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 7 shared commits counted here, the most recent 3 are `81342f42` Add glucose statistics; `7acce5b8` Disable graph setting; `c2044b0f` Fix x compare — run `git show` on any of them.
Change coupling: ReceiveData.kt ↔ XDripBroadcastReceiver.kt common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt` and `common/src/main/java/de/michelinside/glucodatahandler/common/receiver/XDripBroadcastReceiver.kt` change together 61% of the time (11 of the 18 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 11 shared commits counted here, the most recent 3 are `66430873` Fix for 0 value from xDrip #115; `9f156086` Fix xDrip unit change #115; `1f731c86` Move glucose fun to GlucoDataUtils — run `git show` on any of them.
Change coupling: Constants.kt ↔ DataSource.kt common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt` and `common/src/main/java/de/michelinside/glucodatahandler/common/notifier/DataSource.kt` change together 56% of the time (9 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 9 shared commits counted here, the most recent 3 are `ebb6443a` Add AiDex broadcast parser (#288); `a4157831` Found hidden Aidex broadcast intent, implemented with recreation of t…; `4d61d9f2` New local source: Libre patched app — run `git show` on any of them.
Change coupling: AlarmNotification.kt ↔ AlarmAdvancedFragment.kt mobile/src/main/java/de/michelinside/glucodatahandler/notification/AlarmNotification.kt:1— `mobile/src/main/java/de/michelinside/glucodatahandler/notification/AlarmNotification.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmAdvancedFragment.kt` change together 55% of the time (6 of the 11 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 6 shared commits counted here, the most recent 3 are `0121cab2` Alarm delay on phone; `ecaa08fa` No alarm on wear or AA connected; `d3121baa` Update alarm cat prefs — run `git show` on any of them.
Change coupling: GlucoDataServiceWear.kt ↔ ActiveComplicationHandler.kt wear/src/main/java/de/michelinside/glucodatahandler/GlucoDataServiceWear.kt:1— `wear/src/main/java/de/michelinside/glucodatahandler/GlucoDataServiceWear.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/complications/ActiveComplicationHandler.kt` change together 54% of the time (7 of the 13 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 7 shared commits counted here, the most recent 3 are `c0acd2f9` Remove screen off setting from watch; `73a40f26` Wear: No update while watch screen is off; `c0b5ba05` Wear: No update while watch screen is off — run `git show` on any of them.
Change coupling: Constants.kt ↔ AlarmHandler.kt common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt:1— `common/src/main/java/de/michelinside/glucodatahandler/common/Constants.kt` and `common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt` change together 52% of the time (22 of the 42 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 22 shared commits counted here, the most recent 3 are `cbce33a9` Setting for snooze buttons; `73235335` Force very low alarm; `73a40f26` Wear: No update while watch screen is off — run `git show` on any of them.
Change coupling: ActiveWidgetHandler.kt ↔ FloatingWidget.kt mobile/src/main/java/de/michelinside/glucodatahandler/widget/ActiveWidgetHandler.kt:1— `mobile/src/main/java/de/michelinside/glucodatahandler/widget/ActiveWidgetHandler.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/widget/FloatingWidget.kt` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `04c57be5` Floating widget with graph; `13550687` Tap action setting; `31425a4c` New notify source for IOB/COB — run `git show` on any of them.
Change coupling: CarMediaBrowserService.kt ↔ SettingsFragmentBase.kt auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarMediaBrowserService.kt:1— `auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarMediaBrowserService.kt` and `auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `2c65a7a6` GDA: enable progress bar for Fake media player; `62849544` GDA: Speak value settings changed; `cc05f1d7` GDA: fix notification permission — run `git show` on any of them.
Duplicated block (10 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:76— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:76-85 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:91-100 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 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 `auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:76` 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 (10 lines × 2) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:65— common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:65-74 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:98-107 — 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 `common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:120— common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:120-129 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:169-178 — 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 (10 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1033— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1033-1042 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:492-501 — before extracting anything, compare `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 98 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 `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1033` 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 (10 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1091— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1091-1100 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:515-524 — before extracting anything, compare `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 98 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 `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1091` 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 (10 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1264— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1264-1273 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:592-601 — before extracting anything, compare `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 98 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 (10 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:61— mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:61-70 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmGeneralFragment.kt:83-92 — before extracting anything, compare `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmGeneralFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt:16— auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt:16-26 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:81-90 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt` and `common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 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.
Duplicated block (10 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragment.kt:20— auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragment.kt:20-30 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragment.kt:17-26 — 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 `auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragment.kt:20` 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: `BuildConfig` names `de.michelinside.glucodataauto.BuildConfig` in one and `de.michelinside.glucodatahandler.BuildConfig` 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.
MethodTooLong: JsonUtils.typedMapToBundle common/src/main/java/de/michelinside/glucodatahandler/common/utils/JsonUtils.kt:170— MethodTooLong — typedMapToBundle runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× 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: WearPhoneConnection.onMessageReceived common/src/main/java/de/michelinside/glucodatahandler/common/WearPhoneConnection.kt:534— MethodTooLong — onMessageReceived runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× 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: SettingsMigrator.migratePhoneSettings common/src/main/java/de/michelinside/glucodatahandler/common/SettingsMigrator.kt:201— MethodTooLong — migratePhoneSettings runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× 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: WallpaperBase.createWallpaperView mobile/src/main/java/de/michelinside/glucodatahandler/widget/WallpaperBase.kt:279— MethodTooLong — createWallpaperView runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× 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: MainActivity.updateConnectionsTable mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:923— MethodTooLong — updateConnectionsTable runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× 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: SettingsMigrator.migrateSettings common/src/main/java/de/michelinside/glucodatahandler/common/SettingsMigrator.kt:25— MethodTooLong — migrateSettings 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.
MethodTooLong: SettingsActivity.onCreate wear/src/main/java/de/michelinside/glucodatahandler/settings/SettingsActivity.kt:39— MethodTooLong — onCreate runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× 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: Companion.requestWebserverData common/src/main/java/de/michelinside/glucodatahandler/common/receiver/GlucoseDataReceiver.kt:124— MethodTooLong — requestWebserverData runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×8
Edited copy of a member (12 corresponding lines) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1102— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1102-1125 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:526-537 — 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) wear/src/main/java/de/michelinside/glucodatahandler/complications/ActiveComplicationHandler.kt:102— wear/src/main/java/de/michelinside/glucodatahandler/complications/ActiveComplicationHandler.kt:102-113 | wear/src/main/java/de/michelinside/glucodatahandler/complications/ChartComplication.kt:376-388 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/tasker/AndroidAutoConnectionState.kt:44— mobile/src/main/java/de/michelinside/glucodatahandler/tasker/AndroidAutoConnectionState.kt:44-55 | mobile/src/main/java/de/michelinside/glucodatahandler/tasker/WearConnectionState.kt:44-55 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:486— common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:486-497 | common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:566-577 — 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) auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarNotification.kt:372— auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarNotification.kt:372-385 | auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarNotification.kt:387-398 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/BackgroundWorker.kt:26— common/src/main/java/de/michelinside/glucodatahandler/common/tasks/BackgroundWorker.kt:26-37 | common/src/main/java/de/michelinside/glucodatahandler/common/tasks/BackgroundWorker.kt:39-53 — 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) wear/src/main/java/de/michelinside/glucodatahandler/settings/ComplicationsTapActionActivity.kt:57— wear/src/main/java/de/michelinside/glucodatahandler/settings/ComplicationsTapActionActivity.kt:57-69 | wear/src/main/java/de/michelinside/glucodatahandler/settings/VibrationPatternActivity.kt:57-68 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/ui/SelectReceiverPreferenceDialogFragmentCompat.kt:143— common/src/main/java/de/michelinside/glucodatahandler/common/ui/SelectReceiverPreferenceDialogFragmentCompat.kt:143-156 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/VibratePatternPreferenceDialogFragmentCompat.kt:62-73 — 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.
Duplicated block (9 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:484— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:484-492 | mobile/src/main/java/de/michelinside/glucodatahandler/notification/LockscreenActivity.kt:295-303 — 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 `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:484` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:138— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:138-146 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:331-339 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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. Note first that the copies are not typed on the same thing: `R` names `de.michelinside.glucodataauto.R` in one and `de.michelinside.glucodatahandler.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) common/src/main/java/de/michelinside/glucodatahandler/common/chart/TimeValueFormatter.kt:72— common/src/main/java/de/michelinside/glucodatahandler/common/chart/TimeValueFormatter.kt:72-80 | REDACTED:664-672 — 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 (9 lines × 2) common/src/main/java/de/michelinside/glucodatahandler/common/utils/JsonUtils.kt:60— common/src/main/java/de/michelinside/glucodatahandler/common/utils/JsonUtils.kt:60-68 | common/src/main/java/de/michelinside/glucodatahandler/common/utils/JsonUtils.kt:71-79 — 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 (9 lines × 2) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:38— common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:38-46 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/TransferFragments.kt:19-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.
Duplicated block (9 lines × 2) wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmsActivity.kt:112— wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmsActivity.kt:112-120 | wear/src/main/java/de/michelinside/glucodatahandler/settings/SourcesActivity.kt:99-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) common/src/main/java/de/michelinside/glucodatahandler/common/ui/SelectReceiverPreferenceDialogFragmentCompat.kt:92— common/src/main/java/de/michelinside/glucodatahandler/common/ui/SelectReceiverPreferenceDialogFragmentCompat.kt:92-100 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/VibratePatternPreferenceDialogFragmentCompat.kt:35-43 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/tasker/AndroidAutoConnectionState.kt:23— mobile/src/main/java/de/michelinside/glucodatahandler/tasker/AndroidAutoConnectionState.kt:23-31 | mobile/src/main/java/de/michelinside/glucodatahandler/tasker/WearConnectionState.kt:23-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
ClassTooLong: MainActivity mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:97— ClassTooLong — 997 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 597 over it, 2.49× 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: AlarmNotificationBase common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:40— ClassTooLong — 794 significant lines (blank, comment-only and punctuation-only lines excluded), 77 methods. The bar is 400 significant lines; this is 394 over it, 1.99× 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: WearPhoneConnection common/src/main/java/de/michelinside/glucodatahandler/common/WearPhoneConnection.kt:42— ClassTooLong — 604 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 204 over it, 1.51× 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: MainActivity auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:63— ClassTooLong — 494 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 94 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: WearActivity wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:52— ClassTooLong — 436 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 36 over it, 1.09× 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: LibreLinkSourceTask common/src/main/java/de/michelinside/glucodatahandler/common/tasks/LibreLinkSourceTask.kt:31— ClassTooLong — 402 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 2 over it, 1.01× 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: CarMediaBrowserService auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarMediaBrowserService.kt:55— ClassTooLong — 402 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 2 over it, 1.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×6
Edited copy of a member (16 corresponding lines) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1085— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1085-1100 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:509-524 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/notification/SnoozeAlarmReceiver.kt:14— mobile/src/main/java/de/michelinside/glucodatahandler/notification/SnoozeAlarmReceiver.kt:14-29 | wear/src/main/java/de/michelinside/glucodatahandler/SnoozeAlarmReceiverWear.kt:13-28 — 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) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:720— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:720-735 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1341-1360 — 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) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:334— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:334-349 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:500-517 — 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) auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragment.kt:18— auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragment.kt:18-34 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragment.kt:15-30 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:189— mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:189-204 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmGeneralFragment.kt:147-165 — 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 (8 corresponding lines) · ×6
Edited copy of a member (8 corresponding lines) mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:117— mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:117-124 | mobile/src/main/java/de/michelinside/glucodatahandler/widget/GlucoseBaseWidget.kt:114-121 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:108— mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:108-115 | mobile/src/main/java/de/michelinside/glucodatahandler/widget/GlucoseBaseWidget.kt:105-112 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/widget/GlucoseBaseWidget.kt:149— mobile/src/main/java/de/michelinside/glucodatahandler/widget/GlucoseBaseWidget.kt:149-157 | mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:152-159 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:259— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:259-268 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/LogSettingsFragment.kt:92-99 — 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) wear/src/main/java/de/michelinside/glucodatahandler/complications/BgValueComplicationService.kt:146— wear/src/main/java/de/michelinside/glucodatahandler/complications/BgValueComplicationService.kt:146-153 | wear/src/main/java/de/michelinside/glucodatahandler/complications/SmallImageComplication.kt:49-56 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/ui/SelectReceiverPreferenceDialogFragmentCompat.kt:32— common/src/main/java/de/michelinside/glucodatahandler/common/ui/SelectReceiverPreferenceDialogFragmentCompat.kt:32-39 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/VibratePatternPreferenceDialogFragmentCompat.kt:20-28 — 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.
Duplicated block (8 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:63— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:63-70 | auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:70-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:458— mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:458-465 | wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmTypeActivity.kt:312-319 — 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) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:52— wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:52-59 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:55-62 — before extracting anything, compare `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:61— wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:61-68 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:64-71 — before extracting anything, compare `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/StartServiceAtBootReceiver.kt:12— mobile/src/main/java/de/michelinside/glucodatahandler/StartServiceAtBootReceiver.kt:12-19 | wear/src/main/java/de/michelinside/glucodatahandler/StartServiceAtBootReceiver.kt:11-18 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/xdripserver/XDripServer.kt:186— mobile/src/main/java/de/michelinside/glucodatahandler/xdripserver/XDripServer.kt:186-193 | mobile/src/main/java/de/michelinside/glucodatahandler/xdripserver/XDripServer.kt:198-205 — 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 `mobile/src/main/java/de/michelinside/glucodatahandler/xdripserver/XDripServer.kt:186` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×5
Edited copy of a member (17 corresponding lines) mobile/src/main/java/de/michelinside/glucodatahandler/notification/PermanentNotification.kt:76— mobile/src/main/java/de/michelinside/glucodatahandler/notification/PermanentNotification.kt:76-92 | mobile/src/main/java/de/michelinside/glucodatahandler/widget/WallpaperBase.kt:162-181 — 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) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:263— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:263-279 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:342-367 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:384— common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:384-400 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:441-458 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/healthconnect/HealthConnectManager.kt:178— mobile/src/main/java/de/michelinside/glucodatahandler/healthconnect/HealthConnectManager.kt:178-196 | mobile/src/main/java/de/michelinside/glucodatahandler/healthconnect/HealthConnectManager.kt:199-215 — 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) auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarNotification.kt:318— auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarNotification.kt:318-335 | auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarNotification.kt:337-353 — 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) · ×5
Edited copy of a member (11 corresponding lines) common/src/main/java/de/michelinside/glucodatahandler/common/ui/SelectReceiverPreferenceDialogFragmentCompat.kt:49— common/src/main/java/de/michelinside/glucodatahandler/common/ui/SelectReceiverPreferenceDialogFragmentCompat.kt:49-62 | wear/src/main/java/de/michelinside/glucodatahandler/settings/ComplicationsTapActionActivity.kt:89-99 — 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) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:251— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:251-261 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:240-251 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/database/dbSync.kt:82— common/src/main/java/de/michelinside/glucodatahandler/common/database/dbSync.kt:82-92 | mobile/src/main/java/de/michelinside/glucodatahandler/watch/LogcatReceiver.kt:76-88 — 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) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:27— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:27-37 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceFragment.kt:11-24 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt:655— common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt:655-666 | common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt:671-681 — 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 (10 corresponding lines) · ×5
Edited copy of a member (10 corresponding lines) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:137— mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:137-148 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:194-203 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmAdvancedFragment.kt:20— mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmAdvancedFragment.kt:20-30 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceNotificationFragment.kt:15-24 — 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) wear/src/main/java/de/michelinside/glucodatahandler/complications/ShortTextComplication.kt:38— wear/src/main/java/de/michelinside/glucodatahandler/complications/ShortTextComplication.kt:38-47 | wear/src/main/java/de/michelinside/glucodatahandler/complications/TimeComplicationBase.kt:49-59 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/NightscoutSourceTask.kt:153— common/src/main/java/de/michelinside/glucodatahandler/common/tasks/NightscoutSourceTask.kt:153-162 | mobile/src/main/java/de/michelinside/glucodatahandler/transfer/NightscoutUploader.kt:53-62 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) wear/src/main/java/de/michelinside/glucodatahandler/complications/BatteryLevelComplication.kt:109— wear/src/main/java/de/michelinside/glucodatahandler/complications/BatteryLevelComplication.kt:109-118 | wear/src/main/java/de/michelinside/glucodatahandler/complications/BgValueComplicationService.kt:96-105 — 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.
Duplicated block (11 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:102— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:102-112 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:132-142 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 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 (11 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:86— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:86-96 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:239-249 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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 (11 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:48— mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:48-58 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmGeneralFragment.kt:70-80 — before extracting anything, compare `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmGeneralFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) wear/src/main/java/de/michelinside/glucodatahandler/settings/SettingsActivity.kt:179— wear/src/main/java/de/michelinside/glucodatahandler/settings/SettingsActivity.kt:179-190 | wear/src/main/java/de/michelinside/glucodatahandler/settings/SourcesActivity.kt:78-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `wear/src/main/java/de/michelinside/glucodatahandler/settings/SettingsActivity.kt:179` 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 (11 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:133— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:133-143 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:200-210 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 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 `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:133` 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (4 members, 50+ identical tokens) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:88— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:88-180 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:138-257 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1406-1440 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:77-186 — 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.
Members sharing a duplicated core (4 members, 50+ identical tokens) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:483— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:483-524 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:740-792 | mobile/src/main/java/de/michelinside/glucodatahandler/notification/LockscreenActivity.kt:294-322 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:254-300 — 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.
Members sharing a duplicated core (4 members, 50+ identical tokens) auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt:25— auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt:25-63 | auto/src/main/java/de/michelinside/glucodataauto/preferences/LogSettingsFragment.kt:25-48 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/ExportImportSettingsFragment.kt:28-85 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/LogSettingsFragment.kt:37-81 — 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.
Members sharing a duplicated core (4 members, 50+ identical tokens) auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt:65— auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt:65-82 | auto/src/main/java/de/michelinside/glucodataauto/preferences/LogSettingsFragment.kt:70-86 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/ExportImportSettingsFragment.kt:87-104 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/LogSettingsFragment.kt:126-143 — 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.
Duplicated block (6 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/LogSettingsFragment.kt:74— auto/src/main/java/de/michelinside/glucodataauto/preferences/LogSettingsFragment.kt:74-79 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/LogSettingsFragment.kt:130-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auto/src/main/java/de/michelinside/glucodataauto/preferences/LogSettingsFragment.kt:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/LogSettingsFragment.kt:136` calls `requestLogs`, `requireContext` and `auto/src/main/java/de/michelinside/glucodataauto/preferences/LogSettingsFragment.kt:80` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NotificationReceiver.kt:869— common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NotificationReceiver.kt:869-874 | common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NsEmulatorReceiver.kt:42-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:113— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:113-118 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:265-270 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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.
Duplicated block (6 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1133— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1133-1138 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:546-551 — before extracting anything, compare `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 98 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.
Duplicated block (5 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1109— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1109-1125 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:533-537 — before extracting anything, compare `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 98 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 `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1109` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/notification/AlarmNotification.kt:117— mobile/src/main/java/de/michelinside/glucodatahandler/notification/AlarmNotification.kt:117-121 | mobile/src/main/java/de/michelinside/glucodatahandler/notification/PermanentNotification.kt:234-238 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:304— auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:304-308 | common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.kt:75-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:304` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) REDACTED:399— REDACTED:399-403 | mobile/src/main/java/de/michelinside/glucodatahandler/watch/LogcatReceiver.kt:117-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:399` 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.
Hotspot: mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:532— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in MainActivity.onOptionsItemSelected at line 532. 4 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-04..2026-10-02, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-04 17:35:31 +02:00' --until='2026-10-02 17:35:31 +02:00' --full-history --no-merges -- mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:630— common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in ReceiveData.handleIntent at line 630. 2 of those changes were fix/bug commits, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-04..2026-10-02, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-04 17:35:31 +02:00' --until='2026-10-02 17:35:31 +02:00' --full-history --no-merges -- common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: common/src/main/java/de/michelinside/glucodatahandler/common/SettingsMigrator.kt common/src/main/java/de/michelinside/glucodatahandler/common/SettingsMigrator.kt:201— common/src/main/java/de/michelinside/glucodatahandler/common/SettingsMigrator.kt changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in SettingsMigrator.migratePhoneSettings at line 201. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-04..2026-10-02, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-04 17:35:31 +02:00' --until='2026-10-02 17:35:31 +02:00' --full-history --no-merges -- common/src/main/java/de/michelinside/glucodatahandler/common/SettingsMigrator.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×3
Edited copy of a member (18 corresponding lines) mobile/src/main/java/de/michelinside/glucodatahandler/widget/AodWidget.kt:54— mobile/src/main/java/de/michelinside/glucodatahandler/widget/AodWidget.kt:54-75 | mobile/src/main/java/de/michelinside/glucodatahandler/widget/LockScreenWallpaper.kt:100-117 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/healthconnect/HealthConnectManager.kt:333— mobile/src/main/java/de/michelinside/glucodatahandler/healthconnect/HealthConnectManager.kt:333-352 | mobile/src/main/java/de/michelinside/glucodatahandler/transfer/NightscoutUploader.kt:246-263 — 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) wear/src/main/java/de/michelinside/glucodatahandler/complications/BatteryLevelComplication.kt:83— wear/src/main/java/de/michelinside/glucodatahandler/complications/BatteryLevelComplication.kt:83-107 | wear/src/main/java/de/michelinside/glucodatahandler/complications/BgValueComplicationService.kt:107-124 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×3
Edited copy of a member (15 corresponding lines) common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartBitmapHandlerView.kt:61— common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartBitmapHandlerView.kt:61-75 | common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartBitmapView.kt:48-64 — 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) mobile/src/main/java/de/michelinside/glucodatahandler/widget/ActiveWidgetHandler.kt:106— mobile/src/main/java/de/michelinside/glucodatahandler/widget/ActiveWidgetHandler.kt:106-120 | mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidgetNotifier.kt:91-109 — 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) common/src/main/java/de/michelinside/glucodatahandler/common/database/dbAccess.kt:192— common/src/main/java/de/michelinside/glucodatahandler/common/database/dbAccess.kt:192-206 | common/src/main/java/de/michelinside/glucodatahandler/common/database/dbAccess.kt:225-239 — 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.
Duplicated block (15 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:392— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:392-406 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:539-553 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 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 `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:392` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:538` calls `putExtra` and `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:391` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:193— wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:193-207 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:210-224 — before extracting anything, compare `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:193` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (15 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:235— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:235-249 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:434-448 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 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 `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:235` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:99— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:99-110 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:252-263 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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 (12 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/VibratePatternPreferenceDialogFragmentCompat.kt:113— mobile/src/main/java/de/michelinside/glucodatahandler/preferences/VibratePatternPreferenceDialogFragmentCompat.kt:113-124 | wear/src/main/java/de/michelinside/glucodatahandler/settings/VibrationPatternActivity.kt:132-143 — 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 `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/VibratePatternPreferenceDialogFragmentCompat.kt:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/DexcomShareSourceTask.kt:301— common/src/main/java/de/michelinside/glucodatahandler/common/tasks/DexcomShareSourceTask.kt:301-312 | common/src/main/java/de/michelinside/glucodatahandler/common/tasks/NightscoutSourceTask.kt:305-316 — 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.
TodoComment mobile/src/main/java/de/michelinside/glucodatahandler/widget/GlucoseBaseWidget.kt:317— // todo: check for portrait mode for tablets!? — 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 common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:378— // TODO: remove — 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 (34 corresponding lines) · ×2
Edited copy of a member (34 corresponding lines) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:270— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:270-309 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:199-232 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:311— common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:311-344 | common/src/main/java/de/michelinside/glucodatahandler/common/service/StartupTrigger.kt:32-71 — 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 (20 corresponding lines) · ×2
Edited copy of a member (20 corresponding lines) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:55— common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:55-74 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:88-107 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NotificationReceiver.kt:187— common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NotificationReceiver.kt:187-206 | common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NotificationReceiver.kt:225-244 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×2
Edited copy of a member (19 corresponding lines) common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartBitmap.kt:251— common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartBitmap.kt:251-274 | common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartCreator.kt:852-870 — 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) auto/src/main/java/de/michelinside/glucodataauto/preferences/LogSettingsFragment.kt:50— auto/src/main/java/de/michelinside/glucodataauto/preferences/LogSettingsFragment.kt:50-68 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/LogSettingsFragment.kt:106-124 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×2
Edited copies of one member (3 members, 12+ corresponding lines) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:80— wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:80-91 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseGraphTileService.kt:113-125 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:83-94 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) wear/src/main/java/de/michelinside/glucodatahandler/complications/BatteryLevelComplication.kt:36— wear/src/main/java/de/michelinside/glucodatahandler/complications/BatteryLevelComplication.kt:36-48 | wear/src/main/java/de/michelinside/glucodatahandler/complications/BgValueComplicationService.kt:58-69 | wear/src/main/java/de/michelinside/glucodatahandler/complications/ChartComplication.kt:124-137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×2
Edited copies of one member (3 members, 10+ corresponding lines) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1279— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1279-1289 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1330-1339 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:607-616 — 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) auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarNotification.kt:144— auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarNotification.kt:144-155 | common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:204-213 | mobile/src/main/java/de/michelinside/glucodatahandler/watch/WatchDrip.kt:67-78 — 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.
Duplicated block (14 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt:69— auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt:69-82 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/ExportImportSettingsFragment.kt:91-104 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/ExportImportSettingsFragment.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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 `auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt:69` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseGraphTileService.kt:180— wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseGraphTileService.kt:180-193 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:124-137 — before extracting anything, compare `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseGraphTileService.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseGraphTileService.kt:180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseGraphTileService.kt:179` calls `v` and `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:123` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–12 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:341— auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:341-351 | common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.kt:111-122 — 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 `auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:341` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: `DexcomBroadcastReceiver` names `de.michelinside.glucodataauto.receiver.DexcomBroadcastReceiver` in one and `de.michelinside.glucodatahandler.common.receiver.DexcomBroadcastReceiver` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11–12 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:383— auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:383-393 | common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.kt:153-164 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:383` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: `LibrePatchedReceiver` names `de.michelinside.glucodataauto.receiver.LibrePatchedReceiver` in one and `de.michelinside.glucodatahandler.common.receiver.LibrePatchedReceiver` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 3) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmAdvancedFragment.kt:96— mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmAdvancedFragment.kt:96-106 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:103-113 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmGeneralFragment.kt:135-145 — before extracting anything, compare `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmGeneralFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 3) auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt:36— auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt:36-46 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:101-111 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt:83-93 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt` and `common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt:32` calls `updatePreferences` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt:80` 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) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:721— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:721-729 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1342-1350 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:620-628 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 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 `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:721` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:731` calls `currentTimeMillis`, `isOutOfMemoryException`, `showOkDialog` and `wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:629` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:617— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:617-625 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1086-1094 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:510-518 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 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.
Duplicated block (8 lines × 7) auto/src/main/java/de/michelinside/glucodataauto/receiver/AAPSReceiver.kt:12— auto/src/main/java/de/michelinside/glucodataauto/receiver/AAPSReceiver.kt:12-19 | auto/src/main/java/de/michelinside/glucodataauto/receiver/DexcomBroadcastReceiver.kt:12-19 | auto/src/main/java/de/michelinside/glucodataauto/receiver/DiaboxReceiver.kt:12-19 | auto/src/main/java/de/michelinside/glucodataauto/receiver/GlucoDataReceiver.kt:12-19 | auto/src/main/java/de/michelinside/glucodataauto/receiver/LibrePatchedReceiver.kt:11-18 | auto/src/main/java/de/michelinside/glucodataauto/receiver/NsEmulatorReceiver.kt:12-19 | auto/src/main/java/de/michelinside/glucodataauto/receiver/XDripReceiver.kt:12-19 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 7 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 7) wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmAdvancedActivity.kt:169— wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmAdvancedActivity.kt:169-176 | wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmTypeActivity.kt:210-217 | wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmsActivity.kt:122-129 | wear/src/main/java/de/michelinside/glucodatahandler/settings/ComplicationsTapActionActivity.kt:80-87 | wear/src/main/java/de/michelinside/glucodatahandler/settings/SettingsActivity.kt:210-217 | wear/src/main/java/de/michelinside/glucodatahandler/settings/SourcesActivity.kt:109-116 | wear/src/main/java/de/michelinside/glucodatahandler/settings/VibrationPatternActivity.kt:79-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 7 call sites, so a change lands once.
Duplicated block (7 lines × 4) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:486— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:486-492 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:746-752 | mobile/src/main/java/de/michelinside/glucodatahandler/notification/LockscreenActivity.kt:297-303 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:259-265 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:745` calls `updateLandscapeItems` and `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:485` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 4) auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt:67— auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt:67-73 | auto/src/main/java/de/michelinside/glucodataauto/preferences/LogSettingsFragment.kt:72-78 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/ExportImportSettingsFragment.kt:89-95 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/LogSettingsFragment.kt:128-134 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/ExportImportSettingsFragment.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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 `auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt:67` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/LogSettingsFragment.kt:136` calls `requestLogs`, `requireContext` and `auto/src/main/java/de/michelinside/glucodataauto/preferences/LogSettingsFragment.kt:80` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) mobile/src/main/java/de/michelinside/glucodatahandler/healthconnect/HealthConnectPermissionActivity.kt:35— mobile/src/main/java/de/michelinside/glucodatahandler/healthconnect/HealthConnectPermissionActivity.kt:35-42 | mobile/src/main/java/de/michelinside/glucodatahandler/notification/LockscreenActivity.kt:92-99 | mobile/src/main/java/de/michelinside/glucodatahandler/tasker/WriteSettingConfigureActivity.kt:53-60 — 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) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:644— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:644-651 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1166-1173 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:559-566 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 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 `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:644` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmAdvancedActivity.kt:151— wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmAdvancedActivity.kt:151-158 | wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmsActivity.kt:103-110 | wear/src/main/java/de/michelinside/glucodatahandler/settings/SettingsActivity.kt:192-199 | wear/src/main/java/de/michelinside/glucodatahandler/settings/SourcesActivity.kt:90-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (8 lines × 4) wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmAdvancedActivity.kt:160— wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmAdvancedActivity.kt:160-167 | wear/src/main/java/de/michelinside/glucodatahandler/settings/ComplicationsTapActionActivity.kt:71-78 | wear/src/main/java/de/michelinside/glucodatahandler/settings/SettingsActivity.kt:201-208 | wear/src/main/java/de/michelinside/glucodatahandler/settings/VibrationPatternActivity.kt:70-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Blocking `Thread.sleep` inside a coroutine common/src/main/java/de/michelinside/glucodatahandler/common/receiver/GlucoseDataReceiver.kt:142— This coroutine runs on a dispatcher's thread, and `Thread.sleep` blocks that thread: for the whole delay no other coroutine scheduled on it makes progress (on `Dispatchers.Main` the UI freezes) — the Kotlin form of blocking on a task. Use `delay(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a call that cannot be made suspending, move it off the dispatcher with `withContext(Dispatchers.IO) { … }`.
Blocking `Thread.sleep` inside a coroutine common/src/main/java/de/michelinside/glucodatahandler/common/receiver/GlucoseDataReceiver.kt:144— This coroutine runs on a dispatcher's thread, and `Thread.sleep` blocks that thread: for the whole delay no other coroutine scheduled on it makes progress (on `Dispatchers.Main` the UI freezes) — the Kotlin form of blocking on a task. Use `delay(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a call that cannot be made suspending, move it off the dispatcher with `withContext(Dispatchers.IO) { … }`.
Swallowed exception (empty catch) REDACTED:321— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:545— 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.
JsonUtils.typedMapToBundle (cyclomatic 86) common/src/main/java/de/michelinside/glucodatahandler/common/utils/JsonUtils.kt:170— JsonUtils.typedMapToBundle has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WearPhoneConnection.onMessageReceived (cyclomatic 58) common/src/main/java/de/michelinside/glucodatahandler/common/WearPhoneConnection.kt:534— WearPhoneConnection.onMessageReceived has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReceiverManager.updateSourceReceiver (cyclomatic 52) common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.kt:73— ReceiverManager.updateSourceReceiver has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsonUtils.bundleToTypedMap (cyclomatic 49) common/src/main/java/de/michelinside/glucodatahandler/common/utils/JsonUtils.kt:39— JsonUtils.bundleToTypedMap has cyclomatic complexity 49 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
GlucoDataServiceAuto.updateSourceReceiver (cyclomatic 46) auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:302— GlucoDataServiceAuto.updateSourceReceiver has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SettingsMigrator.migratePhoneSettings (cyclomatic 46) common/src/main/java/de/michelinside/glucodatahandler/common/SettingsMigrator.kt:201— SettingsMigrator.migratePhoneSettings has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GlucoseDataReceiver.requestWebserverData (cyclomatic 45) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/GlucoseDataReceiver.kt:124— GlucoseDataReceiver.requestWebserverData has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SettingsMigrator.migrateSettings (cyclomatic 41) common/src/main/java/de/michelinside/glucodatahandler/common/SettingsMigrator.kt:25— SettingsMigrator.migrateSettings has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReceiveData.handleIntent (cyclomatic 35) common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:630— ReceiveData.handleIntent has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MainActivity.updateConnectionsTable (cyclomatic 32) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:923— MainActivity.updateConnectionsTable has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WallpaperBase.createWallpaperView (cyclomatic 30) mobile/src/main/java/de/michelinside/glucodatahandler/widget/WallpaperBase.kt:279— WallpaperBase.createWallpaperView has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GlucoseBaseWidget.getRemoteViews (cyclomatic 26) mobile/src/main/java/de/michelinside/glucodatahandler/widget/GlucoseBaseWidget.kt:192— GlucoseBaseWidget.getRemoteViews has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BroadcastServiceAPI.handleBgBundle (cyclomatic 24) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/BroadcastServiceAPI.kt:133— BroadcastServiceAPI.handleBgBundle has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MainActivity.onOptionsItemSelected (cyclomatic 24) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:532— MainActivity.onOptionsItemSelected has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SourceOnlineFragmentBase.onSharedPreferenceChanged (cyclomatic 23) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:205— SourceOnlineFragmentBase.onSharedPreferenceChanged has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
LibrePatchedReceiver.onReceiveData (cyclomatic 23) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/LibrePatchedReceiver.kt:23— LibrePatchedReceiver.onReceiveData has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
XDripBroadcastReceiver.onReceiveData (cyclomatic 22) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/XDripBroadcastReceiver.kt:48— XDripBroadcastReceiver.onReceiveData has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MedtrumSourceTask.handleMonitorListResponse (cyclomatic 22) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/MedtrumSourceTask.kt:227— MedtrumSourceTask.handleMonitorListResponse has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GlucoDataUtils.getDummyGlucodataIntent (cyclomatic 22) common/src/main/java/de/michelinside/glucodatahandler/common/utils/GlucoDataUtils.kt:187— GlucoDataUtils.getDummyGlucodataIntent has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
XDripServer.createResponse (cyclomatic 21) mobile/src/main/java/de/michelinside/glucodatahandler/xdripserver/XDripServer.kt:286— XDripServer.createResponse has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WearPhoneConnection.sendMessage (cyclomatic 20) common/src/main/java/de/michelinside/glucodatahandler/common/WearPhoneConnection.kt:378— WearPhoneConnection.sendMessage has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WearPhoneConnection.handleCommand (cyclomatic 20) common/src/main/java/de/michelinside/glucodatahandler/common/WearPhoneConnection.kt:741— WearPhoneConnection.handleCommand has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
GlucoseStatistics.getStatisticsTitle (cyclomatic 20) common/src/main/java/de/michelinside/glucodatahandler/common/utils/GlucoseStatistics.kt:144— GlucoseStatistics.getStatisticsTitle has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TimeAxisRenderer.computeNiceAxisValues (cyclomatic 19) common/src/main/java/de/michelinside/glucodatahandler/common/chart/TimeAxisRenderer.kt:57— TimeAxisRenderer.computeNiceAxisValues has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NotificationReceiver.validGlucoseNotification (cyclomatic 19) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NotificationReceiver.kt:410— NotificationReceiver.validGlucoseNotification has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MainActivity.updateDetailsTable (cyclomatic 19) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1127— MainActivity.updateDetailsTable has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AlarmNotificationBase.startSound (cyclomatic 18) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:579— AlarmNotificationBase.startSound has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReceiveData.calculateDeltasAndRate (cyclomatic 17) common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:457— ReceiveData.calculateDeltasAndRate has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ReceiveData.onSharedPreferenceChanged (cyclomatic 19) 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.
BackgroundTaskService.checkExecution (cyclomatic 17) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/BackgroundTaskService.kt:73— BackgroundTaskService.checkExecution has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DexcomShareSourceTask.handleValueResponse (cyclomatic 17) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/DexcomShareSourceTask.kt:158— DexcomShareSourceTask.handleValueResponse has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LibreLinkSourceTask.checkPreferenceChanged (cyclomatic 17) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/LibreLinkSourceTask.kt:596— LibreLinkSourceTask.checkPreferenceChanged has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MainActivity.updateNotesTable (cyclomatic 17) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:799— MainActivity.updateNotesTable has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
XDripServer.onSharedPreferenceChanged (cyclomatic 17) mobile/src/main/java/de/michelinside/glucodatahandler/xdripserver/XDripServer.kt:388— XDripServer.onSharedPreferenceChanged has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AlarmHandler.checkForAlarmTrigger (cyclomatic 16) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt:115— AlarmHandler.checkForAlarmTrigger has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NightscoutSourceTask.handleEntriesResponse (cyclomatic 16) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/NightscoutSourceTask.kt:172— NightscoutSourceTask.handleEntriesResponse has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BitmapUtils.calcMaxTextSizeForBitmap (cyclomatic 16) common/src/main/java/de/michelinside/glucodatahandler/common/utils/BitmapUtils.kt:67— BitmapUtils.calcMaxTextSizeForBitmap has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AlarmNotification.buildNotification (cyclomatic 16) mobile/src/main/java/de/michelinside/glucodatahandler/notification/AlarmNotification.kt:79— AlarmNotification.buildNotification has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Repeated repair: mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt:105— mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is SettingsFragmentBase.onSharedPreferenceChanged at line 105), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Fix AOD settings for Android 17”; “Android 17 - AOD: Advanced Protection and permission bug”; “fix sensor start time”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-04..2026-10-02, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-04 17:35:31 +02:00' --until='2026-10-02 17:35:31 +02:00' --full-history --no-merges -- mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
JsonUtils.typedMapToBundle (cognitive 168) common/src/main/java/de/michelinside/glucodatahandler/common/utils/JsonUtils.kt:170— JsonUtils.typedMapToBundle has cognitive complexity 168 (threshold 15). Drivers by points: if/else 50 (94 pts), match/switch 12 (47 pts), error handling 5 (24 pts), boolean chains 2, loops 1 (nesting depth added 98). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GlucoseDataReceiver.requestWebserverData (cognitive 142) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/GlucoseDataReceiver.kt:124— GlucoseDataReceiver.requestWebserverData has cognitive complexity 142 (threshold 15). Drivers by points: if/else 39 (116 pts), boolean chains 12, error handling 3 (12 pts), loops 1 (2 pts) (nesting depth added 87). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WearPhoneConnection.onMessageReceived (cognitive 141) common/src/main/java/de/michelinside/glucodatahandler/common/WearPhoneConnection.kt:534— WearPhoneConnection.onMessageReceived has cognitive complexity 141 (threshold 15). Drivers by points: if/else 51 (129 pts), boolean chains 7, error handling 2 (5 pts) (nesting depth added 81). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ReceiverManager.updateSourceReceiver (cognitive 99) common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.kt:73— ReceiverManager.updateSourceReceiver has cognitive complexity 99 (threshold 15). Drivers by points: if/else 41 (89 pts), boolean chains 9, error handling 1 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
GlucoDataServiceAuto.updateSourceReceiver (cognitive 87) auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:302— GlucoDataServiceAuto.updateSourceReceiver has cognitive complexity 87 (threshold 15). Drivers by points: if/else 36 (78 pts), boolean chains 8, error handling 1 (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MedtrumSourceTask.handleMonitorListResponse (cognitive 75) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/MedtrumSourceTask.kt:227— MedtrumSourceTask.handleMonitorListResponse has cognitive complexity 75 (threshold 15). Drivers by points: if/else 18 (70 pts), boolean chains 4, loops 1 (nesting depth added 52). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ReceiveData.handleIntent (cognitive 73) common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:630— ReceiveData.handleIntent has cognitive complexity 73 (threshold 15). Drivers by points: if/else 34 (64 pts), boolean chains 8, error handling 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsMigrator.migratePhoneSettings (cognitive 63) common/src/main/java/de/michelinside/glucodatahandler/common/SettingsMigrator.kt:201— SettingsMigrator.migratePhoneSettings has cognitive complexity 63 (threshold 15). Drivers by points: if/else 34 (50 pts), boolean chains 13 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainActivity.updateConnectionsTable (cognitive 63) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:923— MainActivity.updateConnectionsTable has cognitive complexity 63 (threshold 15). Drivers by points: if/else 27 (44 pts), error handling 5 (15 pts), boolean chains 4 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsMigrator.migrateSettings (cognitive 58) common/src/main/java/de/michelinside/glucodatahandler/common/SettingsMigrator.kt:25— SettingsMigrator.migrateSettings has cognitive complexity 58 (threshold 15). Drivers by points: if/else 31 (43 pts), boolean chains 12, match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LibrePatchedReceiver.onReceiveData (cognitive 57) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/LibrePatchedReceiver.kt:23— LibrePatchedReceiver.onReceiveData has cognitive complexity 57 (threshold 15). Drivers by points: if/else 15 (49 pts), boolean chains 7, error handling 1 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
XDripBroadcastReceiver.onReceiveData (cognitive 54) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/XDripBroadcastReceiver.kt:48— XDripBroadcastReceiver.onReceiveData has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (49 pts), boolean chains 4, error handling 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
GlucoseStatistics.getStatisticsTitle (cognitive 52) common/src/main/java/de/michelinside/glucodatahandler/common/utils/GlucoseStatistics.kt:144— GlucoseStatistics.getStatisticsTitle has cognitive complexity 52 (threshold 15). Drivers by points: if/else 24 (51 pts), match/switch 1 (nesting depth added 27). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
GlucoseBaseWidget.getRemoteViews (cognitive 48) mobile/src/main/java/de/michelinside/glucodatahandler/widget/GlucoseBaseWidget.kt:192— GlucoseBaseWidget.getRemoteViews has cognitive complexity 48 (threshold 15). Drivers by points: if/else 30 (44 pts), boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BroadcastServiceAPI.handleBgBundle (cognitive 47) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/BroadcastServiceAPI.kt:133— BroadcastServiceAPI.handleBgBundle has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 6, error handling 1 (3 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WallpaperBase.createWallpaperView (cognitive 46) mobile/src/main/java/de/michelinside/glucodatahandler/widget/WallpaperBase.kt:279— WallpaperBase.createWallpaperView has cognitive complexity 46 (threshold 15). Drivers by points: if/else 32 (38 pts), boolean chains 6, error handling 1, match/switch 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AAPSReceiver.onReceiveData (cognitive 45) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/AAPSReceiver.kt:32— AAPSReceiver.onReceiveData has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (43 pts), boolean chains 1, error handling 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NsEmulatorReceiver.onReceiveData (cognitive 42) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NsEmulatorReceiver.kt:24— NsEmulatorReceiver.onReceiveData has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (39 pts), boolean chains 2, error handling 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MainActivity.updateDetailsTable (cognitive 42) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1127— MainActivity.updateDetailsTable has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 5 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NotificationReceiver.validGlucoseNotification (cognitive 41) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NotificationReceiver.kt:410— NotificationReceiver.validGlucoseNotification has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (39 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonUtils.bundleToTypedMap (cognitive 40) common/src/main/java/de/michelinside/glucodatahandler/common/utils/JsonUtils.kt:39— JsonUtils.bundleToTypedMap has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 5 (14 pts), boolean chains 8, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GlucoDataUtils.getDummyGlucodataIntent (cognitive 38) common/src/main/java/de/michelinside/glucodatahandler/common/utils/GlucoDataUtils.kt:187— GlucoDataUtils.getDummyGlucodataIntent has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 7 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AlarmNotification.buildNotification (cognitive 38) mobile/src/main/java/de/michelinside/glucodatahandler/notification/AlarmNotification.kt:79— AlarmNotification.buildNotification has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (37 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimeAxisRenderer.computeNiceAxisValues (cognitive 37) common/src/main/java/de/michelinside/glucodatahandler/common/chart/TimeAxisRenderer.kt:57— TimeAxisRenderer.computeNiceAxisValues has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (27 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BackgroundTaskService.checkExecution (cognitive 37) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/BackgroundTaskService.kt:73— BackgroundTaskService.checkExecution has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 6 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ReceiveData.calculateDeltasAndRate (cognitive 36) common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:457— ReceiveData.calculateDeltasAndRate has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DexcomShareSourceTask.handleValueResponse (cognitive 36) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/DexcomShareSourceTask.kt:158— DexcomShareSourceTask.handleValueResponse has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XDripServer.createResponse (cognitive 35) mobile/src/main/java/de/michelinside/glucodatahandler/xdripserver/XDripServer.kt:286— XDripServer.createResponse has cognitive complexity 35 (threshold 15). Drivers by points: if/else 31, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WearActivity.updateConnectionsTable (cognitive 34) wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:441— WearActivity.updateConnectionsTable has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (34 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WearPhoneConnection.sendMessage (cognitive 33) common/src/main/java/de/michelinside/glucodatahandler/common/WearPhoneConnection.kt:378— WearPhoneConnection.sendMessage has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 7, error handling 3 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NightscoutSourceTask.handleEntriesResponse (cognitive 33) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/NightscoutSourceTask.kt:172— NightscoutSourceTask.handleEntriesResponse has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 3, loops 1 (3 pts), error handling 1 (2 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
PermanentNotification.createNotificationRemoteView (cognitive 33) mobile/src/main/java/de/michelinside/glucodatahandler/notification/PermanentNotification.kt:212— PermanentNotification.createNotificationRemoteView has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LibreLinkSourceTask.checkPreferenceChanged (cognitive 31) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/LibreLinkSourceTask.kt:596— LibreLinkSourceTask.checkPreferenceChanged has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainActivity.updateNotesTable (cognitive 30) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:799— MainActivity.updateNotesTable has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 4 (9 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LockscreenSettingsFragment.checkPermissions (cognitive 30) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt:478— LockscreenSettingsFragment.checkPermissions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 3 (10 pts), boolean chains 2 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AlarmNotificationBase.startSound (cognitive 29) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:579— AlarmNotificationBase.startSound has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 6, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LibreLinkSourceTask.parseGraphData (cognitive 29) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/LibreLinkSourceTask.kt:444— LibreLinkSourceTask.parseGraphData has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BitmapUtils.calcMaxTextSizeForBitmap (cognitive 28) common/src/main/java/de/michelinside/glucodatahandler/common/utils/BitmapUtils.kt:67— BitmapUtils.calcMaxTextSizeForBitmap has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatisticsData.update (cognitive 28) common/src/main/java/de/michelinside/glucodatahandler/common/utils/GlucoseStatistics.kt:78— StatisticsData.update has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (27 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextToSpeechUtils.initTextToSpeech (cognitive 27) common/src/main/java/de/michelinside/glucodatahandler/common/utils/TextToSpeechUtils.kt:38— TextToSpeechUtils.initTextToSpeech has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (23 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AlarmNotificationBase.checkCreateSound (cognitive 26) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:684— AlarmNotificationBase.checkCreateSound has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 2, error handling 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CarNotification.canShowNotification (cognitive 25) auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarNotification.kt:203— CarNotification.canShowNotification has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChartCreator.addEmptyTimeData (cognitive 25) common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartCreator.kt:528— ChartCreator.addEmptyTimeData has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LibreLinkSourceTask.parseGlucoseData (cognitive 25) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/LibreLinkSourceTask.kt:528— LibreLinkSourceTask.parseGlucoseData has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 2 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
XDripServer.onSharedPreferenceChanged (cognitive 25) mobile/src/main/java/de/michelinside/glucodatahandler/xdripserver/XDripServer.kt:388— XDripServer.onSharedPreferenceChanged has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActiveComplicationHandler.OnNotifyData (cognitive 25) wear/src/main/java/de/michelinside/glucodatahandler/complications/ActiveComplicationHandler.kt:144— ActiveComplicationHandler.OnNotifyData has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MedtrumSourceTask.handleGraphDataResponse (cognitive 24) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/MedtrumSourceTask.kt:339— MedtrumSourceTask.handleGraphDataResponse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BackgroundTaskService.startTimer (cognitive 23) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/BackgroundTaskService.kt:295— BackgroundTaskService.startTimer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (23 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MedtrumSourceTask.checkPreferenceChanged (cognitive 23) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/MedtrumSourceTask.kt:430— MedtrumSourceTask.checkPreferenceChanged has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Utils.getDeviceInformations (cognitive 23) REDACTED:276— Utils.getDeviceInformations has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (3 pts), boolean chains 2, error handling 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DexcomBroadcastReceiver.onReceiveData (cognitive 22) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/DexcomBroadcastReceiver.kt:28— DexcomBroadcastReceiver.onReceiveData has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WatchDrip.addGraph (cognitive 22) mobile/src/main/java/de/michelinside/glucodatahandler/watch/WatchDrip.kt:197— WatchDrip.addGraph has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GlucoseValueTileService.buildLayout (cognitive 22) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:123— GlucoseValueTileService.buildLayout has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChartCreator.addEntries (cognitive 21) common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartCreator.kt:485— ChartCreator.addEntries has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CustomBubbleMarker.findNearestIndex (cognitive 21) common/src/main/java/de/michelinside/glucodatahandler/common/chart/CustomBubbleMarker.kt:202— CustomBubbleMarker.findNearestIndex has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 3, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NotificationReceiver.parseString (cognitive 21) common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NotificationReceiver.kt:656— NotificationReceiver.parseString has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NightscoutSourceTask.handlePebbleResponse (cognitive 21) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/NightscoutSourceTask.kt:230— NightscoutSourceTask.handlePebbleResponse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CarModeReceiver.sendToGlucoDataAuto (cognitive 21) mobile/src/main/java/de/michelinside/glucodatahandler/android_auto/CarModeReceiver.kt:120— CarModeReceiver.sendToGlucoDataAuto has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 2, error handling 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FloatingWidget.createWindow (cognitive 21) mobile/src/main/java/de/michelinside/glucodatahandler/widget/FloatingWidget.kt:115— FloatingWidget.createWindow has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, error handling 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GlucoDataService.start (cognitive 20) common/src/main/java/de/michelinside/glucodatahandler/common/GlucoDataService.kt:100— GlucoDataService.start has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AiDexCgmParser.parse (cognitive 20) common/src/main/java/de/michelinside/glucodatahandler/common/utils/AiDexCgmParser.kt:19— AiDexCgmParser.parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, error handling 1, match/switch 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MainActivity.checkMissingPermissions (cognitive 20) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:369— MainActivity.checkMissingPermissions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PermanentNotification.getNotification (cognitive 20) mobile/src/main/java/de/michelinside/glucodatahandler/notification/PermanentNotification.kt:267— PermanentNotification.getNotification has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WearActivity.updateDetailsTable (cognitive 20) wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:539— WearActivity.updateDetailsTable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CustomBubbleMarker.draw (cognitive 19) common/src/main/java/de/michelinside/glucodatahandler/common/chart/CustomBubbleMarker.kt:135— CustomBubbleMarker.draw has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CustomBubbleMarker.onChartTranslate (cognitive 19) common/src/main/java/de/michelinside/glucodatahandler/common/chart/CustomBubbleMarker.kt:278— CustomBubbleMarker.onChartTranslate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AlarmHandler.checkForAlarmTrigger (cognitive 19) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt:115— AlarmHandler.checkForAlarmTrigger has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AlarmNotificationBase.checkRetriggerAndAutoClose (cognitive 19) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:1005— AlarmNotificationBase.checkRetriggerAndAutoClose has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataSourceTask.handleResult (cognitive 19) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/DataSourceTask.kt:362— DataSourceTask.handleResult has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Utils.formatDurationFromSeconds (cognitive 19) REDACTED:697— Utils.formatDurationFromSeconds has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (19 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WallpaperBase.onSharedPreferenceChanged (cognitive 19) mobile/src/main/java/de/michelinside/glucodatahandler/widget/WallpaperBase.kt:122— WallpaperBase.onSharedPreferenceChanged has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, error handling 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AlarmHandler.checkDeltaAlarmTrigger (cognitive 18) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt:225— AlarmHandler.checkDeltaAlarmTrigger has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LibreLinkSourceTask.handleError4 (cognitive 18) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/LibreLinkSourceTask.kt:165— LibreLinkSourceTask.handleError4 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CarMediaBrowserService.getBackgroundImage (cognitive 17) auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarMediaBrowserService.kt:449— CarMediaBrowserService.getBackgroundImage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 1, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CarMediaPlayer.playMedia (cognitive 17) auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarMediaPlayer.kt:146— CarMediaPlayer.playMedia has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReceiveData.getAsText (cognitive 17) common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:221— ReceiveData.getAsText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SourceOnlineFragmentBase.updateEnableStates (cognitive 17) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:279— SourceOnlineFragmentBase.updateEnableStates has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BackgroundTaskService.executeTasks (cognitive 17) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/BackgroundTaskService.kt:139— BackgroundTaskService.executeTasks has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (9 pts), if/else 3 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DexcomShareSourceTask.checkPreferenceChanged (cognitive 17) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/DexcomShareSourceTask.kt:320— DexcomShareSourceTask.checkPreferenceChanged has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackageUtils.updatePackages (cognitive 17) common/src/main/java/de/michelinside/glucodatahandler/common/utils/PackageUtils.kt:28— PackageUtils.updatePackages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Utils.parseTimeAndGetNextTimestamp (cognitive 17) REDACTED:588— Utils.parseTimeAndGetNextTimestamp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AlarmTypeFragment.setRingtoneSelect (cognitive 17) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:398— AlarmTypeFragment.setRingtoneSelect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BatteryLevelWidget.onUpdate (cognitive 17) mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidget.kt:73— BatteryLevelWidget.onUpdate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (14 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CarNotification.updateSettings (cognitive 16) auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarNotification.kt:89— CarNotification.updateSettings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReceiveData.hasNewIobCob (cognitive 16) common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:765— ReceiveData.hasNewIobCob has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChartBitmap.waitForCreation (cognitive 16) common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartBitmap.kt:85— ChartBitmap.waitForCreation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 6, boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BackgroundTaskService.checkTimer (cognitive 16) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/BackgroundTaskService.kt:217— BackgroundTaskService.checkTimer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, error handling 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataSourceTask.checkPreferenceChanged (cognitive 16) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/DataSourceTask.kt:557— DataSourceTask.checkPreferenceChanged has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainActivity.onOptionsItemSelected (cognitive 16) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:532— MainActivity.onOptionsItemSelected has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NightscoutUploader.onSharedPreferenceChanged (cognitive 16) mobile/src/main/java/de/michelinside/glucodatahandler/transfer/NightscoutUploader.kt:209— NightscoutUploader.onSharedPreferenceChanged has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WearActivity.updateNotesTable (cognitive 16) wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:392— WearActivity.updateNotesTable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 3 (6 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Near-duplicate member pair (27 shared lines) auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:302— auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:302-410 | common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.kt:73-197 — These two members are variants of one another: 27 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 (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) auto/src/main/java/de/michelinside/glucodataauto/receiver/AAPSReceiver.kt:11— auto/src/main/java/de/michelinside/glucodataauto/receiver/AAPSReceiver.kt:11-19 | auto/src/main/java/de/michelinside/glucodataauto/receiver/DexcomBroadcastReceiver.kt:11-19 | auto/src/main/java/de/michelinside/glucodataauto/receiver/DiaboxReceiver.kt:11-19 | auto/src/main/java/de/michelinside/glucodataauto/receiver/GlucoDataReceiver.kt:11-19 | auto/src/main/java/de/michelinside/glucodataauto/receiver/LibrePatchedReceiver.kt:10-18 | auto/src/main/java/de/michelinside/glucodataauto/receiver/NsEmulatorReceiver.kt:11-19 | auto/src/main/java/de/michelinside/glucodataauto/receiver/XDripReceiver.kt:11-19 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Edited copy of a member (91 corresponding lines) · ×1
Edited copy of a member (91 corresponding lines) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:117— wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:117-207 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:123-224 — These two members are one piece of code written twice and then edited apart: 91 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (45 corresponding lines) · ×1
Edited copy of a member (45 corresponding lines) common/src/main/java/de/michelinside/glucodatahandler/common/tasks/DexcomShareSourceTask.kt:320— common/src/main/java/de/michelinside/glucodatahandler/common/tasks/DexcomShareSourceTask.kt:320-364 | common/src/main/java/de/michelinside/glucodatahandler/common/tasks/MedtrumSourceTask.kt:430-481 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (49 corresponding lines) · ×1
Edited copy of a member (49 corresponding lines) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:281— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:281-332 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:450-498 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/VibratePatternPreferenceDialogFragmentCompat.kt:89— mobile/src/main/java/de/michelinside/glucodatahandler/preferences/VibratePatternPreferenceDialogFragmentCompat.kt:89-124 | wear/src/main/java/de/michelinside/glucodatahandler/settings/VibrationPatternActivity.kt:103-143 — 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 (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:370— mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:370-396 | wear/src/main/java/de/michelinside/glucodatahandler/settings/AlarmTypeActivity.kt:288-310 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:712— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:712-737 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:364-385 — 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 (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:256— auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:256-284 | mobile/src/main/java/de/michelinside/glucodatahandler/android_auto/CarModeReceiver.kt:92-118 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt:543— common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt:543-575 | common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt:616-649 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) auto/src/main/java/de/michelinside/glucodataauto/preferences/AppSettingsActivity.kt:89— auto/src/main/java/de/michelinside/glucodataauto/preferences/AppSettingsActivity.kt:89-112 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AppSettingsActivity.kt:91-114 — 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 copies of one member (3 members, 14+ corresponding lines) · ×1
Edited copies of one member (3 members, 14+ corresponding lines) auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt:70— auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt:70-83 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:142-156 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt:161-175 — 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 (3 members, 21+ corresponding lines) · ×1
Edited copies of one member (3 members, 21+ corresponding lines) common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:1098— common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:1098-1118 | wear/src/main/java/de/michelinside/glucodatahandler/complications/ActiveComplicationHandler.kt:76-100 | wear/src/main/java/de/michelinside/glucodatahandler/complications/ChartComplication.kt:348-374 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×1
Edited copies of one member (3 members, 13+ corresponding lines) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:657— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:657-669 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1244-1257 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:572-585 — 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 (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) mobile/src/main/java/de/michelinside/glucodatahandler/StartServiceReceiver.kt:12— mobile/src/main/java/de/michelinside/glucodatahandler/StartServiceReceiver.kt:12-25 | wear/src/main/java/de/michelinside/glucodatahandler/StartServiceReceiver.kt:12-25 — 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 copies of one member (4 members, 11+ corresponding lines) · ×1
Edited copies of one member (4 members, 11+ corresponding lines) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:61— common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:61-73 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:181-192 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmAdvancedFragment.kt:42-52 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:125-135 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×1
Edited copy of a member (6 corresponding lines) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:87— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:87-92 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:115-120 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×1
Edited copy of a member (4 corresponding lines) mobile/src/main/java/de/michelinside/glucodatahandler/tasker/AndroidAutoConnectionState.kt:36— mobile/src/main/java/de/michelinside/glucodatahandler/tasker/AndroidAutoConnectionState.kt:36-39 | mobile/src/main/java/de/michelinside/glucodatahandler/tasker/WearConnectionState.kt:36-39 — 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.
Duplicated block (55–56 lines × 2) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:119— wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:119-174 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:129-183 — before extracting anything, compare `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:119` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (49 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AppSettingsActivity.kt:29— auto/src/main/java/de/michelinside/glucodataauto/preferences/AppSettingsActivity.kt:29-77 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AppSettingsActivity.kt:30-78 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/AppSettingsActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AppSettingsActivity.kt` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AppSettingsActivity.kt:81` calls `v` and `auto/src/main/java/de/michelinside/glucodataauto/preferences/AppSettingsActivity.kt:80` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (28 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:115— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:115-142 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:145-172 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 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 (26–32 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:97— auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:97-128 | common/src/main/java/de/michelinside/glucodatahandler/common/SettingsMigrator.kt:336-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 (20 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AppSettingsActivity.kt:93— auto/src/main/java/de/michelinside/glucodataauto/preferences/AppSettingsActivity.kt:93-112 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AppSettingsActivity.kt:95-114 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/AppSettingsActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AppSettingsActivity.kt` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `auto/src/main/java/de/michelinside/glucodataauto/preferences/AppSettingsActivity.kt:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17–18 lines × 2) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:99— wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:99-115 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:104-121 — before extracting anything, compare `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:43— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:43-59 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:107-123 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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. Note first that the copies are not typed on the same thing: `R` names `de.michelinside.glucodataauto.R` in one and `de.michelinside.glucodatahandler.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (16–17 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:120— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:120-135 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt:312-328 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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 `auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmTypeFragment.kt:120` 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 (16 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:294— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:294-309 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:463-478 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 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 `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:294` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:487— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:487-499 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:747-760 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 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.
Duplicated block (13 lines × 3) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:118— wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:118-130 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseGraphTileService.kt:184-196 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:128-140 — before extracting anything, compare `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:124` calls `deltaStr`, `iobLineText`, `cobLineText` and `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:117` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–13 lines × 3) wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:126— wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:126-136 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseGraphTileService.kt:206-218 | wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt:136-147 — before extracting anything, compare `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseDetailsTileService.kt:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:505— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:505-516 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:770-782 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 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.
Duplicated block (11 lines × 4) auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt:26— auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt:26-36 | auto/src/main/java/de/michelinside/glucodataauto/preferences/LogSettingsFragment.kt:27-37 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/ExportImportSettingsFragment.kt:30-40 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/LogSettingsFragment.kt:39-49 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/ExportImportSettingsFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/ExportImportSettingsFragment.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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.
Duplicated block (10 lines × 3) auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt:74— auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt:74-83 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:147-156 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt:166-175 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt` and `common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 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 `auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt:74` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:450— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:450-458 | auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:572-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 2) auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:145— auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt:145-157 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:175-187 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/AlarmFragment.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 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 (6 lines × 4) auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:103— auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:103-108 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:148-153 | mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1415-1420 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:89-94 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt` and `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 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.
Duplicated block (5–6 lines × 2) mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:725— mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:725-730 | wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt:377-381 — before extracting anything, compare `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt` and `wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 98 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 `mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:725` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 9) auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragment.kt:47— auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragment.kt:47-55 | auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt:48-56 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceNotificationFragment.kt:38-46 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:113-121 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:109-117 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmAdvancedFragment.kt:54-62 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmFragment.kt:72-80 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmGeneralFragment.kt:94-102 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt:95-103 — before extracting anything, compare `auto/src/main/java/de/michelinside/glucodataauto/preferences/SettingsFragmentBase.kt` and `common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 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.
Duplicated block (6 lines × 3) common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:94— common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:94-99 | common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.kt:161-166 | mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt:177-182 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:92` calls `initPreferences` and `mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt:175` 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.
No structured logging — No logging call was found in the 229 JVM production file(s) this check read across 4 module(s). Each was searched for its ecosystem's logging libraries (JVM: SLF4J, Log4j2, java.util.logging, Logback, kotlin-logging, scala-logging) and for a call on a receiver named `log`/`logger` (or ending in `Logger`/`_logger`) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read — this is 'no logging found by this walk', not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose.
Outbound HTTP without resilience common/src/main/java/de/michelinside/glucodatahandler/common/utils/HttpRequest.kt:97— `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×1
Recursive walk over a caller-supplied document has no depth cap common/src/main/java/de/michelinside/glucodatahandler/common/tasks/NightscoutSourceTask.kt:51— `NightscoutSourceTask.parsePebbleIobCob` is public and takes `jsonObject: JSONObject` from its caller, and it calls itself at line 51 with a piece of `jsonObject` — the function is not `tailrec`, so every call is a real frame — and nowhere in `NightscoutSourceTask.parsePebbleIobCob` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `NightscoutSourceTask.parsePebbleIobCob` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
Swallowed exception (caught, then discarded) common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartBitmap.kt:144— `catch (exc: 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.
Duplicated predicate mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1134— `!ReceiveData.eiob.isNaN() && !ReceiveData.isIobCobObsolete()` appears character-identically in 2 files — mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt, wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.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 common/src/main/java/de/michelinside/glucodatahandler/common/receiver/BroadcastServiceAPI.kt:200— `!ReceiveData.isIobCobObsolete() && !ReceiveData.iob.isNaN()` appears character-identically in 2 files — common/src/main/java/de/michelinside/glucodatahandler/common/receiver/BroadcastServiceAPI.kt, mobile/src/main/java/de/michelinside/glucodatahandler/watch/WatchDrip.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 mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1130— `!ReceiveData.isObsoleteLong() && sharedPref.getBoolean(Constants.SHARED_PREF_SHOW_OTHER_UNIT, false)` appears character-identically in 2 files — mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt, wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.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 auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:97— `!sharedPref.contains(Constants.SHARED_PREF_SOURCE_JUGGLUCO_WEBSERVER_ENABLED) || !sharedPref.contains(Constants.SHARED_PREF_SOURCE_JUGGLUCO_…` appears character-identically in 2 files — auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt, common/src/main/java/de/michelinside/glucodatahandler/common/SettingsMigrator.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 auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:264— `Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !Utils.canScheduleExactAlarms(this)` appears character-identically in 2 files — auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt, mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.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 auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:488— `ReceiveData.isObsoleteShort() && !ReceiveData.isObsoleteLong()` appears character-identically in 8 files — auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt, auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarMediaBrowserService.kt, common/src/main/java/de/michelinside/glucodatahandler/common/utils/BitmapUtils.kt, mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.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 mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt:1146— `ReceiveData.sensorStartTime > 0 && !GlucoDataUtils.isSensorExpired(this)` appears character-identically in 2 files — mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt, wear/src/main/java/de/michelinside/glucodatahandler/WearActivity.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 auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt:294— `ReceiveData.source == DataSource.LIBRELINK && !sharedPref.contains(Constants.SHARED_PREF_LLU_5_WARNING_SHOWN)` appears character-identically in 2 files — auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt, mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.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 mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmGeneralFragment.kt:129— `Utils.isValidTime(prefStart!!.getTimeString()) && Utils.isValidTime(prefEnd!!.getTimeString()) && prefWeekdays.values.isNotEmpty()` appears character-identically in 2 files — mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmGeneralFragment.kt, mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.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 common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt:347— `alarmManager != null && alarmPendingIntent != null` appears character-identically in 2 files — common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt, common/src/main/java/de/michelinside/glucodatahandler/common/service/StartupTrigger.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 common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartBitmapHandler.kt:59— `chartBitmap == null && GlucoDataService.isServiceRunning` appears character-identically in 2 files — common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartBitmapHandler.kt, mobile/src/main/java/de/michelinside/glucodatahandler/notification/PermanentNotification.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 auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarMediaBrowserService.kt:360— `dataSource == NotifySource.BROADCAST || dataSource == NotifySource.MESSAGECLIENT` appears character-identically in 2 files — auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarMediaBrowserService.kt, auto/src/main/java/de/michelinside/glucodataauto/android_auto/CarNotification.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 mobile/src/main/java/de/michelinside/glucodatahandler/healthconnect/HealthConnectManager.kt:337— `dataSource == NotifySource.DB_DATA_CHANGED && extras != null` appears character-identically in 2 files — mobile/src/main/java/de/michelinside/glucodatahandler/healthconnect/HealthConnectManager.kt, mobile/src/main/java/de/michelinside/glucodatahandler/transfer/NightscoutUploader.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 mobile/src/main/java/de/michelinside/glucodatahandler/notification/SnoozeAlarmReceiver.kt:21— `intent.hasExtra(Constants.ALARM_SNOOZE_EXTRA_START_APP) && intent.getBooleanExtra(Constants.ALARM_SNOOZE_EXTRA_START_APP, true)` appears character-identically in 2 files — mobile/src/main/java/de/michelinside/glucodatahandler/notification/SnoozeAlarmReceiver.kt, wear/src/main/java/de/michelinside/glucodatahandler/SnoozeAlarmReceiverWear.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 wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseGraphTileService.kt:273— `iobText.isNotEmpty() && cobText.isNotEmpty()` appears character-identically in 2 files — wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseGraphTileService.kt, wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.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 wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseGraphTileService.kt:232— `iobText.isNotEmpty() || cobText.isNotEmpty()` appears character-identically in 2 files — wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseGraphTileService.kt, wear/src/main/java/de/michelinside/glucodatahandler/tile/GlucoseValueTileService.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 auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:332— `key.isNullOrEmpty() || key == Constants.SHARED_PREF_SOURCE_AAPS_ENABLED` appears character-identically in 2 files — auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt, common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.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 auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:345— `key.isNullOrEmpty() || key == Constants.SHARED_PREF_SOURCE_BYODA_ENABLED` appears character-identically in 2 files — auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt, common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.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 auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:374— `key.isNullOrEmpty() || key == Constants.SHARED_PREF_SOURCE_DIABOX_ENABLED` appears character-identically in 2 files — auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt, common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.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 auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:361— `key.isNullOrEmpty() || key == Constants.SHARED_PREF_SOURCE_EVERSENSE_ENABLED` appears character-identically in 2 files — auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt, common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.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 auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:306— `key.isNullOrEmpty() || key == Constants.SHARED_PREF_SOURCE_JUGGLUCO_ENABLED` appears character-identically in 2 files — auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt, common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.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 auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:387— `key.isNullOrEmpty() || key == Constants.SHARED_PREF_SOURCE_LIBRE_PATCHED_ENABLED` appears character-identically in 2 files — auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt, common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.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 auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:403— `key.isNullOrEmpty() || key == Constants.SHARED_PREF_SOURCE_NOTIFICATION_ENABLED` appears character-identically in 2 files — auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt, common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.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 auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt:319— `key.isNullOrEmpty() || key == Constants.SHARED_PREF_SOURCE_XDRIP_ENABLED` appears character-identically in 2 files — auto/src/main/java/de/michelinside/glucodataauto/GlucoDataServiceAuto.kt, common/src/main/java/de/michelinside/glucodatahandler/common/service/ReceiverManager.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 common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt:58— `prefSources != null && preferenceManager.sharedPreferences != null` appears character-identically in 2 files — common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOfflineFragment.kt, common/src/main/java/de/michelinside/glucodatahandler/common/preferences/SourceOnlineFragment.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.
Orphaned file mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidgetNotifier.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/src/main/java/de/michelinside/glucodatahandler/common/utils/AiDexCgmParser.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/src/main/java/de/michelinside/glucodatahandler/common/receiver/AidexBroadcastReceiver.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.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×2
Projects may be oversized for their cohesion common/build.gradle:1— `common` (19191 LoC, 299 module-visible types across 13 directories) overshoots its size bounds. 2 of 4 build unit(s) (Gradle) overshoot their size bounds, lowering Project Cohesion to 0.7/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.
Projects may be oversized for their cohesion mobile/build.gradle:1— `mobile` (9836 LoC, 149 module-visible types across 10 directories) overshoots its size bounds. 2 of 4 build unit(s) (Gradle) overshoot their size bounds, lowering Project Cohesion to 0.7/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.
Fat interface: GlucoseValueDao (24 abstract methods) common/src/main/java/de/michelinside/glucodatahandler/common/database/GlucoseValueDao.kt:10— `GlucoseValueDao` declares 24 abstract methods: `insertValue`, `insertValues`, `updateRate`, `getValues`, `getValue`, `getValuesByTime`, `getLastTopNValues`, `getValuesInRange`, `getLiveValues`, `getLiveValuesByTimeSpan`, `getLiveValuesByStartTime`, `getLastTimestamp`, `getFirstTimestamp`, `getCount`, `getCountByTime`, `getMaxValue`, `getMaxValueByTime`, `getAverageValue`, `getValuesInRangeCount`, `getPreviousValue`, `deleteValue`, `deleteValues`, `deleteOldValues`, `deleteAllValues`. 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 74 significant file(s) lose their only recent owner: mobile/src/main/java/de/michelinside/glucodatahandler/MainActivity.kt, common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt, common/src/main/java/de/michelinside/glucodatahandler/common/receiver/NotificationReceiver.kt, auto/src/main/java/de/michelinside/glucodataauto/MainActivity.kt, common/src/main/java/de/michelinside/glucodatahandler/common/chart/ChartCreator.kt, common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmHandler.kt, mobile/src/main/java/de/michelinside/glucodatahandler/preferences/SettingsFragmentBase.kt, REDACTED (+66 more). Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (75 single-owned of 156 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 156 of the 234 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: common/src/main/java/de/michelinside/glucodatahandler/common/chart/ValueBitmapHandler.kt.
No ADRs found wear/build.gradle:2— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `wear/build.gradle` makes this repository a deployable product (line 2).
D21 · Naming Consistency· `sensorID` spells `ID` where 77 names in the project spell it `Id` · ×1
`sensorID` spells `ID` where 77 names in the project spell it `Id` common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:52— 77 of 78 names in project common spell the token `Id` (77 of 78; unit: names in project common containing `Id`). Peers: GlucoDataService.onStartCommand(startId) (common/src/main/java/de/michelinside/glucodatahandler/common/GlucoDataService.kt:199); GlucoDataService.onTimeout(startId) (common/src/main/java/de/michelinside/glucodatahandler/common/GlucoDataService.kt:382); ReceiveData.setSensorStartTime(serialId) (common/src/main/java/de/michelinside/glucodatahandler/common/ReceiveData.kt:1101); SourceState.resId (common/src/main/java/de/michelinside/glucodatahandler/common/SourceState.kt:10); Companion.getNodeBatteryLevel(nodeId) (common/src/main/java/de/michelinside/glucodatahandler/common/WearPhoneConnection.kt:127). Rename to `sensorId`. [rule N6]
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 3 of 156 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 156 of the 234 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: mobile/src/main/java/de/michelinside/glucodatahandler/widget/BatteryLevelWidgetNotifier.kt, common/src/main/java/de/michelinside/glucodatahandler/common/utils/AiDexCgmParser.kt, common/src/main/java/de/michelinside/glucodatahandler/common/receiver/AidexBroadcastReceiver.kt. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation· No architecture diagram/doc · ×1
No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
No SAST — 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) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 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.
No dependency-update automation auto/build.gradle:104— `auto/build.gradle` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
Not-null assertions (`!!`) override null safety — ~20.9 `!!` not-null assertions per 1k Kotlin product lines — 859 across the 41083 line(s) of the 225 Kotlin file(s) read (generated, test and sample code not counted). Densest: mobile/src/main/java/de/michelinside/glucodatahandler/preferences/AlarmTypeFragment.kt (64), common/src/main/java/de/michelinside/glucodatahandler/common/tasks/LibreLinkSourceTask.kt (39), common/src/main/java/de/michelinside/glucodatahandler/common/notification/AlarmNotificationBase.kt (37). Each one tells the compiler to trust the author about null and becomes a `NullPointerException` the first time the author is wrong. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Off the main sequence: :common — :common: abstractness 0.05, instability 0.00, distance 0.95 — 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.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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 4 file(s) — `common/src/main/java/de/michelinside/glucodatahandler/common/GlucoDataService.kt`, `common/src/main/java/de/michelinside/glucodatahandler/common/chart/TimeAxisRenderer.kt`, `common/src/main/java/de/michelinside/glucodatahandler/common/utils/AiDexCgmParser.kt`, `mobile/src/main/java/de/michelinside/glucodatahandler/transfer/NightscoutUploader.kt` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).
0
—
Run 01a1e550-2811-7d50-9403-e25b2a727ae8 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 8 · Warnings: 383 · Recommendations: 55 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 17:03 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.