Public report of chmouel/liseur, published 17 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey β
Signed and filed in the standard's public register, 17 November 2026, 01:59 UTC Β· Survey ID cd_d540c0fd265c44daa5cf29e709e0521a
chmouel/liseur
Measured 17 November 2026, 01:51 UTC, at code version 74f3976
First survey, so nothing to compare with yet
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 151,071 lines of product code in 3 projects, tests not counted Β· Estimated rebuild effort: about 1.8 person-years Β· Weakest lens: Accessibility, 46.6
Findings by how serious they are
12 critical857 serious231 minor
13 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 01:51 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 βΈ
76of 76 dimensions measured by tools.
970of 1100 findings point to an exact file and line, so you can open each one in the code. The other 130 concern the repository as a whole, such as missing documentation.
76dimensions across 8 lenses, read from 151,071 lines of product code in 3 projects.
chmouel/liseur falls short of our standard for a preview release because it has pages that don't say their language and images with no text description. It scores 52.1 out of 100 and is rated Adequate, and five of its 12 critical findings are security problems.
Accessibility, at 46.6, is the weakest lens and counts most in the score. The best first step is structuring the pages, worth about 4.3 points. Adding text alternatives comes next, worth about 4.0 points. Raising Accessibility to 65 would lift the score to about 56.0.
Three images have no description for people who can't see them. Two automatic updates take new releases before a bad one can be spotted, and two known security holes in the packages the code depends on can be used by attackers. Describing the images, setting a waiting period for automatic updates and updating the vulnerable packages would close these risks. Limiting each secret to its own step would fix the secret exposed to more of the pipeline than needed. The two pages or frames without a title need a descriptive title.
The product code is 151,071 lines, about β¬260,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts 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 Accessibility rose from 46.6 to 65, the lowest score rated Strong, the score would rise from 52.1 to about 56.0.
Code composition: what the lines of code are
Product code 63%Tests 37%
Rebuild cost: about β¬260,000 Β· Estimate
Cost to rebuild
β¬88,000 to β¬440,000, for 1,464 to 4,645 hours of work, about 1.8 person-years for 1 to 4 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 52. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 151,071 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
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Raises the score by about 4.3 points Β· Medium effort Β· Page structure
2
Add a text alternative β alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Raises the score by about 4.0 points Β· Medium effort Β· Text alternatives
3
Give each aggregate one way in that can refuse β a guarded constructor, value-object parameters that validate themselves, or a private constructor behind a factory that returns a failure.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed Β· Value at risk
This code would cost about β¬260,000 to build again, about 1.8 person-years of work. Its weakest lens is Accessibility, at 46.6 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
One cause behind 80 Domain Modelling findings Β· Common cause
80 findings in the Domain Modelling lens come from the same cause. The code models the business as objects, such as an order or a customer, and each object should guard its own rules: an order, for example, should refuse to be shipped before it has been paid. Here the objects don't do that. Some objects only hold data, while the rules that should keep that data valid sit elsewhere in the code. Identifiers, such as order numbers and customer numbers, are passed around as plain numbers or text, so nothing stops the code from using one kind where another belongs. Because all of these findings have the same cause, fixing it once, in the business objects themselves, deals with them together.
Based on: Rich vs anemic model (40 findings) · Strongly-typed ids (40 findings)
What to do: Give each business object the methods that enforce its rules, such as a method for shipping an order that first checks it has been paid, and let only those methods change its data. Give each kind of identifier a type of its own, so an order number can't be used where a customer number belongs.
If you do one thing first Β· First action
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh. Of all the actions in this report, it raises the score most for the work it takes: about 4.3 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year Β· Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 9% on every change. The history of the code shows how much it changes: about 418,279 lines over the last 90 days, which is about 1,696,354 lines a year. At that pace, the extra work comes to an estimated 173.5 to 1041.2 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
589 modules, with 764 dependencies between them. 2 loops run through 87 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 549 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.
companion.CompanionView uses companion, so a change to companion can break companion.CompanionView, while a change to companion.CompanionView can't break companion.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6β25 data.bookorbit.BookOrbitCfi uses data.bookorbitpart of a loop✕
Connections
3 pairs of types, where a type in data.bookorbit.BookOrbitCfi uses a type in data.bookorbit.
data.bookorbit.BookOrbitCfi uses data.bookorbit, so a change to data.bookorbit can break data.bookorbit.BookOrbitCfi, while a change to data.bookorbit.BookOrbitCfi can't break data.bookorbit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
7β27 data.bookorbit.BookOrbitUploadClient uses data.remotepart of a loop✕
Connections
2 pairs of types, where a type in data.bookorbit.BookOrbitUploadClient uses a type in data.remote.
data.bookorbit.BookOrbitUploadClient uses data.remote, so a change to data.remote can break data.bookorbit.BookOrbitUploadClient, while a change to data.bookorbit.BookOrbitUploadClient can't break data.remote.
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.
reader.annotations uses data.settings, so a change to data.settings can break reader.annotations, while a change to reader.annotations can't break data.settings.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9β30 reader.annotations uses data.dbpart of a loop✕
Connections
2 pairs of types, where a type in reader.annotations uses a type in data.db.
reader.progress uses data.settings, so a change to data.settings can break reader.progress, while a change to reader.progress can't break data.settings.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10β25 reader.progress uses data.bookorbitpart of a loop✕
Connections
7 pairs of types, where a type in reader.progress uses a type in data.bookorbit.
reader.progress uses data.bookorbit, so a change to data.bookorbit can break reader.progress, while a change to reader.progress can't break data.bookorbit.
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.
data.bookorbit.BookOrbitCfi.Component uses data.bookorbit.BookOrbitCfi, so a change to data.bookorbit.BookOrbitCfi can break data.bookorbit.BookOrbitCfi.Component, while a change to data.bookorbit.BookOrbitCfi.Component can't break data.bookorbit.BookOrbitCfi.
Position
Below the diagonal: data.bookorbit.BookOrbitCfi.Component uses a module listed above it, which is the healthy direction.
data.calibre uses domain, so a change to domain can break data.calibre, while a change to data.calibre can't break domain.
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.
13β27 data.calibre uses data.remotepart of a loop✕
Connections
33 pairs of types, where a type in data.calibre uses a type in data.remote. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
data.settings uses data.settings.fonts, so a change to data.settings.fonts can break data.settings, while a change to data.settings can't break data.settings.fonts.
Position
Below the diagonal: data.settings uses a module listed above it, which is the healthy direction.
data.settings uses reader.annotations, so a change to reader.annotations can break data.settings, while a change to data.settings can't break reader.annotations.
Position
Below the diagonal: data.settings uses a module listed above it, which is the healthy direction.
data.settings uses reader.progress, so a change to reader.progress can break data.settings, while a change to data.settings can't break reader.progress.
Position
Below the diagonal: data.settings uses a module listed above it, which is the healthy direction.
reader.ReaderViewModel uses data.calibre, so a change to data.calibre can break reader.ReaderViewModel, while a change to reader.ReaderViewModel can't break data.calibre.
Position
Below the diagonal: reader.ReaderViewModel uses a module listed above it, which is the healthy direction.
reader.ReaderViewModel uses data.settings, so a change to data.settings can break reader.ReaderViewModel, while a change to reader.ReaderViewModel can't break data.settings.
Position
Below the diagonal: reader.ReaderViewModel uses a module listed above it, which is the healthy direction.
15β19 reader.ReaderViewModel uses readerpart of a loop✕
Connections
1 pair of types, where a type in reader.ReaderViewModel uses a type in reader.
reader.ReaderViewModel uses reader, so a change to reader can break reader.ReaderViewModel, while a change to reader.ReaderViewModel can't break reader.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15β24 reader.ReaderViewModel uses domainpart of a loop✕
Connections
1 pair of types, where a type in reader.ReaderViewModel uses a type in domain.
reader.ReaderViewModel uses domain, so a change to domain can break reader.ReaderViewModel, while a change to reader.ReaderViewModel can't break domain.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15β25 reader.ReaderViewModel uses data.bookorbitpart of a loop✕
Connections
8 pairs of types, where a type in reader.ReaderViewModel uses a type in data.bookorbit.
reader.ReaderViewModel uses data.bookorbit, so a change to data.bookorbit can break reader.ReaderViewModel, while a change to reader.ReaderViewModel can't break data.bookorbit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15β27 reader.ReaderViewModel uses data.remotepart of a loop✕
Connections
5 pairs of types, where a type in reader.ReaderViewModel uses a type in data.remote.
reader.ReaderViewModel uses data.remote, so a change to data.remote can break reader.ReaderViewModel, while a change to reader.ReaderViewModel can't break data.remote.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15β30 reader.ReaderViewModel uses data.dbpart of a loop✕
Connections
1 pair of types, where a type in reader.ReaderViewModel uses a type in data.db.
reader.ReaderViewModel uses data.db, so a change to data.db can break reader.ReaderViewModel, while a change to reader.ReaderViewModel can't break data.db.
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.
ui.reading uses data.settings.fonts, so a change to data.settings.fonts can break ui.reading, while a change to ui.reading can't break data.settings.fonts.
Position
Below the diagonal: ui.reading uses a module listed above it, which is the healthy direction.
ui.reading uses reader.annotations, so a change to reader.annotations can break ui.reading, while a change to ui.reading can't break reader.annotations.
Position
Below the diagonal: ui.reading uses a module listed above it, which is the healthy direction.
reader.chrome uses reader.annotations, so a change to reader.annotations can break reader.chrome, while a change to reader.chrome can't break reader.annotations.
Position
Below the diagonal: reader.chrome uses a module listed above it, which is the healthy direction.
reader.chrome uses reader.progress, so a change to reader.progress can break reader.chrome, while a change to reader.chrome can't break reader.progress.
Position
Below the diagonal: reader.chrome uses a module listed above it, which is the healthy direction.
34 pairs of types, where a type in reader.chrome uses a type in data.settings. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
reader.chrome uses reader.ReaderViewModel, so a change to reader.ReaderViewModel can break reader.chrome, while a change to reader.chrome can't break reader.ReaderViewModel.
Position
Below the diagonal: reader.chrome uses a module listed above it, which is the healthy direction.
reader.ReaderViewModel.BookSync uses reader.ReaderViewModel, so a change to reader.ReaderViewModel can break reader.ReaderViewModel.BookSync, while a change to reader.ReaderViewModel.BookSync can't break reader.ReaderViewModel.
Position
Below the diagonal: reader.ReaderViewModel.BookSync uses a module listed above it, which is the healthy direction.
reader.ReaderViewModel.BookSync uses reader.chrome, so a change to reader.chrome can break reader.ReaderViewModel.BookSync, while a change to reader.ReaderViewModel.BookSync can't break reader.chrome.
Position
Below the diagonal: reader.ReaderViewModel.BookSync uses a module listed above it, which is the healthy direction.
18β25 reader.ReaderViewModel.BookSync uses data.bookorbitpart of a loop✕
Connections
1 pair of types, where a type in reader.ReaderViewModel.BookSync uses a type in data.bookorbit.
reader.ReaderViewModel.BookSync uses data.bookorbit, so a change to data.bookorbit can break reader.ReaderViewModel.BookSync, while a change to reader.ReaderViewModel.BookSync can't break data.bookorbit.
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.
18β27 reader.ReaderViewModel.BookSync uses data.remotepart of a loop✕
Connections
1 pair of types, where a type in reader.ReaderViewModel.BookSync uses a type in data.remote.
reader.ReaderViewModel.BookSync uses data.remote, so a change to data.remote can break reader.ReaderViewModel.BookSync, while a change to reader.ReaderViewModel.BookSync can't break data.remote.
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.
37 pairs of types, where a type in reader uses a type in data.settings. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
reader uses reader.ReaderViewModel, so a change to reader.ReaderViewModel can break reader, while a change to reader can't break reader.ReaderViewModel.
Position
Below the diagonal: reader uses a module listed above it, which is the healthy direction.
reader uses reader.ReaderViewModel.BookSync, so a change to reader.ReaderViewModel.BookSync can break reader, while a change to reader can't break reader.ReaderViewModel.BookSync.
Position
Below the diagonal: reader uses a module listed above it, which is the healthy direction.
27 pairs of types, where a type in translate uses a type in data.settings. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
data.bookorbit uses data.bookorbit.BookOrbitCfi, so a change to data.bookorbit.BookOrbitCfi can break data.bookorbit, while a change to data.bookorbit can't break data.bookorbit.BookOrbitCfi.
Position
Below the diagonal: data.bookorbit uses a module listed above it, which is the healthy direction.
data.bookorbit uses data.bookorbit.BookOrbitUploadClient, so a change to data.bookorbit.BookOrbitUploadClient can break data.bookorbit, while a change to data.bookorbit can't break data.bookorbit.BookOrbitUploadClient.
Position
Below the diagonal: data.bookorbit uses a module listed above it, which is the healthy direction.
data.bookorbit uses data.bookorbit.BookOrbitCfi.Component, so a change to data.bookorbit.BookOrbitCfi.Component can break data.bookorbit, while a change to data.bookorbit can't break data.bookorbit.BookOrbitCfi.Component.
Position
Below the diagonal: data.bookorbit uses a module listed above it, which is the healthy direction.
data.bookorbit uses domain, so a change to domain can break data.bookorbit, while a change to data.bookorbit can't break domain.
Position
Below the diagonal: data.bookorbit uses a module listed above it, which is the healthy direction.
25β27 data.bookorbit uses data.remotepart of a loop✕
Connections
37 pairs of types, where a type in data.bookorbit uses a type in data.remote. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
data.bookorbit uses data.library, so a change to data.library can break data.bookorbit, while a change to data.bookorbit can't break data.library.
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.
25β30 data.bookorbit uses data.dbpart of a loop✕
Connections
37 pairs of types, where a type in data.bookorbit uses a type in data.db. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
data.komga uses domain, so a change to domain can break data.komga, while a change to data.komga can't break domain.
Position
Below the diagonal: data.komga uses a module listed above it, which is the healthy direction.
26β27 data.komga uses data.remotepart of a loop✕
Connections
33 pairs of types, where a type in data.komga uses a type in data.remote. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
46 pairs of types, where a type in data.remote uses a type in data.db. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
data.remote uses com.chmouel.liseur, so a change to com.chmouel.liseur can break data.remote, while a change to data.remote can't break com.chmouel.liseur.
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.
39 pairs of types, where a type in data.library uses a type in data.db. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
companion uses companion.CompanionView, so a change to companion.CompanionView can break companion, while a change to companion can't break companion.CompanionView.
Position
Below the diagonal: companion uses a module listed above it, which is the healthy direction.
data.liseursync.LiseurSyncPositionSync uses data.remote, so a change to data.remote can break data.liseursync.LiseurSyncPositionSync, while a change to data.liseursync.LiseurSyncPositionSync can't break data.remote.
Position
Below the diagonal: data.liseursync.LiseurSyncPositionSync uses a module listed above it, which is the healthy direction.
data.liseursync.LiseurSyncPositionSync uses data.db, so a change to data.db can break data.liseursync.LiseurSyncPositionSync, while a change to data.liseursync.LiseurSyncPositionSync can't break data.db.
Position
Below the diagonal: data.liseursync.LiseurSyncPositionSync uses a module listed above it, which is the healthy direction.
32β35 data.liseursync.LiseurSyncPositionSync uses data.liseursyncpart of a loop✕
Connections
3 pairs of types, where a type in data.liseursync.LiseurSyncPositionSync uses a type in data.liseursync.
data.liseursync.LiseurSyncPositionSync uses data.liseursync, so a change to data.liseursync can break data.liseursync.LiseurSyncPositionSync, while a change to data.liseursync.LiseurSyncPositionSync can't break data.liseursync.
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.
data.quotes.HomeQuotes uses data.db, so a change to data.db can break data.quotes.HomeQuotes, while a change to data.quotes.HomeQuotes can't break data.db.
Position
Below the diagonal: data.quotes.HomeQuotes uses a module listed above it, which is the healthy direction.
33β36 data.quotes.HomeQuotes uses data.quotespart of a loop✕
Connections
1 pair of types, where a type in data.quotes.HomeQuotes uses a type in data.quotes.
data.quotes.HomeQuotes uses data.quotes, so a change to data.quotes can break data.quotes.HomeQuotes, while a change to data.quotes.HomeQuotes can't break data.quotes.
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.
ui.settings uses data.settings.fonts, so a change to data.settings.fonts can break ui.settings, while a change to ui.settings can't break data.settings.fonts.
Position
Below the diagonal: ui.settings uses a module listed above it, which is the healthy direction.
ui.settings uses reader.annotations, so a change to reader.annotations can break ui.settings, while a change to ui.settings can't break reader.annotations.
Position
Below the diagonal: ui.settings uses a module listed above it, which is the healthy direction.
data.liseursync uses data.settings, so a change to data.settings can break data.liseursync, while a change to data.liseursync can't break data.settings.
Position
Below the diagonal: data.liseursync uses a module listed above it, which is the healthy direction.
57 pairs of types, where a type in data.liseursync uses a type in data.remote. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
51 pairs of types, where a type in data.liseursync uses a type in data.db. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
data.liseursync uses data.liseursync.LiseurSyncPositionSync, so a change to data.liseursync.LiseurSyncPositionSync can break data.liseursync, while a change to data.liseursync can't break data.liseursync.LiseurSyncPositionSync.
Position
Below the diagonal: data.liseursync uses a module listed above it, which is the healthy direction.
data.quotes uses data.quotes.HomeQuotes, so a change to data.quotes.HomeQuotes can break data.quotes, while a change to data.quotes can't break data.quotes.HomeQuotes.
Position
Below the diagonal: data.quotes uses a module listed above it, which is the healthy direction.
33 pairs of types, where a type in ui.library uses a type in data.remote. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
36 pairs of types, where a type in ui.library uses a type in data.db. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
com.chmouel.liseur uses ui.navigation, so a change to ui.navigation can break com.chmouel.liseur, while a change to com.chmouel.liseur can't break ui.navigation.
Position
Below the diagonal: com.chmouel.liseur uses a module listed above it, which is the healthy direction.
com.chmouel.liseur uses data.calibre, so a change to data.calibre can break com.chmouel.liseur, while a change to com.chmouel.liseur can't break data.calibre.
Position
Below the diagonal: com.chmouel.liseur uses a module listed above it, which is the healthy direction.
com.chmouel.liseur uses data.settings, so a change to data.settings can break com.chmouel.liseur, while a change to com.chmouel.liseur can't break data.settings.
Position
Below the diagonal: com.chmouel.liseur uses a module listed above it, which is the healthy direction.
com.chmouel.liseur uses data.bookorbit, so a change to data.bookorbit can break com.chmouel.liseur, while a change to com.chmouel.liseur can't break data.bookorbit.
Position
Below the diagonal: com.chmouel.liseur uses a module listed above it, which is the healthy direction.
com.chmouel.liseur uses data.komga, so a change to data.komga can break com.chmouel.liseur, while a change to com.chmouel.liseur can't break data.komga.
Position
Below the diagonal: com.chmouel.liseur uses a module listed above it, which is the healthy direction.
com.chmouel.liseur uses data.remote, so a change to data.remote can break com.chmouel.liseur, while a change to com.chmouel.liseur can't break data.remote.
Position
Below the diagonal: com.chmouel.liseur uses a module listed above it, which is the healthy direction.
com.chmouel.liseur uses data.library, so a change to data.library can break com.chmouel.liseur, while a change to com.chmouel.liseur can't break data.library.
Position
Below the diagonal: com.chmouel.liseur uses a module listed above it, which is the healthy direction.
com.chmouel.liseur uses data.kosync, so a change to data.kosync can break com.chmouel.liseur, while a change to com.chmouel.liseur can't break data.kosync.
Position
Below the diagonal: com.chmouel.liseur uses a module listed above it, which is the healthy direction.
com.chmouel.liseur uses ui.settings, so a change to ui.settings can break com.chmouel.liseur, while a change to com.chmouel.liseur can't break ui.settings.
Position
Below the diagonal: com.chmouel.liseur uses a module listed above it, which is the healthy direction.
com.chmouel.liseur uses data.liseursync, so a change to data.liseursync can break com.chmouel.liseur, while a change to com.chmouel.liseur can't break data.liseursync.
Position
Below the diagonal: com.chmouel.liseur uses a module listed above it, which is the healthy direction.
com.chmouel.liseur uses data.quotes, so a change to data.quotes can break com.chmouel.liseur, while a change to com.chmouel.liseur can't break data.quotes.
Position
Below the diagonal: com.chmouel.liseur uses a module listed above it, which is the healthy direction.
com.chmouel.liseur uses ui.library, so a change to ui.library can break com.chmouel.liseur, while a change to com.chmouel.liseur can't break ui.library.
Position
Below the diagonal: com.chmouel.liseur uses a module listed above it, which is the healthy direction.
ui.library.styles uses data.calibre, so a change to data.calibre can break ui.library.styles, while a change to ui.library.styles can't break data.calibre.
Position
Below the diagonal: ui.library.styles uses a module listed above it, which is the healthy direction.
ui.library.styles uses data.quotes, so a change to data.quotes can break ui.library.styles, while a change to ui.library.styles can't break data.quotes.
Position
Below the diagonal: ui.library.styles uses a module listed above it, which is the healthy direction.
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
13
High / Critical
A03:2025 β Software Supply Chain Failures
6
High / Critical
Roadmap
Top priorities: Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh; Add a text alternative β alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video; Give each aggregate one way in that can refuse β a guarded constructor, value-object parameters that validate themselves, or a private constructor behind a factory that returns a failure.
Ranked by impact Γ· effort. "Helps" is the estimated gain on the 0β100 health score.
Do this
Helps
Effort
Dimension
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Add a text alternative β alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Give each aggregate one way in that can refuse β a guarded constructor, value-object parameters that validate themselves, or a private constructor behind a factory that returns a failure.
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs β or `semgrep --config=auto`, which runs on any language β so a security regression fails the build instead of landing.
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 β 12
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 β 857
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 β 231
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 76 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: β Measured β a deterministic fact (LoC, complexity, coverage); ~ Modeled β an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): β Tool-verified means the property itself was measured across the surface; β Nothing flagged means the probes came back clean β a claim bounded by what a repository can show; β Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence β absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked β 76 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, 970 of 1100 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.
D12 Dependency Hygiene β measured, with a gap in what it reached β We measured this, but not all of it. What we did not reach is a gap on our side β a collector, parser or image we have not built yet β so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Currency was graded against Maven Central, but whether an artifact is DEPRECATED is not: Maven Central publishes no deprecation marker, exactly as rubygems.org does not. Whether one is UNMAINTAINED is not graded either β no registry publishes a maintenance status, and release age does not stand in for one. Two of this dimension's four signals are therefore unread on a Gradle tree, and its score reflects currency alone.
D14 License Compliance β 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. This repository declares package.json, but the licence verdict published here was taken over its JVM dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor β not measured this run β This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository β bus factor is not applicable (5 contributor(s) across 1436 commit(s) sampled, automation and bot accounts excluded). One of them holds 99% of the history; the other 4 hold 0.2% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated β so the bus factor is not applicable and there is nothing here for the owner to act on.
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 β 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. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run β this says nothing about whether their names are consistent.
D21 Naming Consistency β 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. 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 β 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. 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: 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. For npm the surface is what a published package.json's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
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. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D25 ADR Conformance β 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. The code index reads C#, Razor, TypeScript, JavaScript and Vue. A rule whose scope holds production code in another language is not called honoured, because its uses could sit in that code.
D32 Data Compliance (PII/GDPR) β not measured this run β We could not measure this here. That is a gap on our side β a collector, parser or image we have not built yet β and it is neither a defect in this repository nor evidence that the check would have passed. `app/src/main/kotlin/com/chmouel/liseur/companion/CompanionFailureView.kt`, `app/src/main/kotlin/com/chmouel/liseur/companion/Investigation.kt`, `app/src/main/kotlin/com/chmouel/liseur/companion/StoryTab.kt`, `app/src/main/kotlin/com/chmouel/liseur/data/NetworkAvailability.kt`, `app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitAdoptedSource.kt`, β¦ (+48 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AX1 Captive dependencies β not measured this run β We could not measure this here. That is a gap on our side β a collector, parser or image we have not built yet β and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in app/src/main/kotlin/com/chmouel/liseur/AppContainer.kt, whose lifetimes are not modelled 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.
AXB2 Runtime readiness β 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. `npm run` found no package.json in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. (rule: no-root-manifest). The renderer reported: the dev server (`npm run start`) exited before it served a page. Likely cause (our sandbox): `npm run` found no package.json in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. Last output: "npm error code ENOENT / npm error syscall open / npm error path <repo>/package.json / npm error errno -2 / npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '<repo>/package.json' / npm error enoent This is related to npm not being able to find a file. / npm error enoent / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered.
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.
DM11 Constructible invalid state β 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. 12 further occurrence(s) are not listed individually; the score already reflects all 52.
DM2 Strongly-typed ids β 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. 29 further occurrence(s) are not listed individually; the score already reflects all 69.
DM4 Rich vs anemic model β 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. 11 further occurrence(s) are not listed individually; the score already reflects all 51.
DM8 Value-object opportunities β not measured this run β We could not measure this here. That is a gap on our side β a collector, parser or image we have not built yet β and it is neither a defect in this repository nor evidence that the check would have passed. This check finds primitive parameters that travel together through several signatures of the domain (a missing value object). Its deterministic rule has not yet shown 95 % precision on adjudicated rows, so the clumps it finds are counted here and not published as findings, and the card carries no score. That is a limit of the analyzer, not a finding about your code.
DM9 Scattered domain decisions β measured, with a gap in what it reached β We measured this, but not all of it. What we did not reach is a gap on our side β a collector, parser or image we have not built yet β so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The frontend declares that it computes whether a construction is produced or passed, yet 2953 of 2955 constructions arrived without the answer. Arm two skipped them; it did not clear them.
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.
M4 Documentation accuracy β measured, with a gap in what it reached β We measured this, but not all of it. What we did not reach is a gap on our side β a collector, parser or image we have not built yet β so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
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.
X24 Document value interpolated into markup unescaped β not measured this run β We could not measure this here. That is a gap on our side β a collector, parser or image we have not built yet β and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach β not a finding about this repository.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared β every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap β a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see β the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically β it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type β a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module β one class/IIFE β earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity β an in-process token-stream comparison over sliding windows, with type-aware normalization β so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED β its repetition is the tool's, not the team's β so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies β runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic β it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules β an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D11 Test Reliability: Flakiness is inferred from history/markers β we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles β a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree β a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy β mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history β a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual β undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded β it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
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.
D25 ADR Conformance: ADR conformance checks only decisions stated in a checkable form (a ruled-out element, package or dependency, an adr-rules block, a declared delivery status): a decision written only as prose is unverifiable, and decisions never written down are not checked.
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").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases β a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension β code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS β files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen β a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen β a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally β the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC3 Page structure: Page structure is read from the static markup tree β landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction β literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${β¦}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics β a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
C4 Data Retention: This control is scored from in-repo evidence only β its real-world effectiveness, exercised only at runtime, is outside a static scan.
DM4 Rich vs anemic model: Behaviour is detected as state mutation inside a method body β a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
DM6 Domain β infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see β only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence β a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
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.
93 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ReaderScreenKt.ReaderScreen at 523. A further 10 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 ContributorRoles.of at 26 β they are counted neither in the figure above nor in this dimension's score. 6 files carry no cyclomatic complexity row at all for this reason β every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: app/src/main/kotlin/com/chmouel/liseur/domain/BookDetails.kt (ContributorRoles.of at 26), app/src/main/kotlin/com/chmouel/liseur/reader/progress/FooterFigure.kt (FooterFigureKt.footerFigure at 19), app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt (TranslationSettingsScreenKt.errorSentence at 19), app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncServerSetup.kt (LiseurSyncServerSetup.failureFor at 16), app/src/main/kotlin/com/chmouel/liseur/reader/annotations/SelectionWebSearch.kt (SelectionWebSearchKt.selectionWebUrl at 16), and 1 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 88 more group(s) β more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity β start with ReaderScreenKt.ReaderScreen (cyclomatic 523). β Refactoring it lifts Cyclomatic Complexity from 4.3 to about 5.8/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.
+ 162 more group(s) β more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 240 down to 240 or less in Cognitive Complexity β start with ReaderScreenKt.ReaderScreen (cognitive 716). β Refactoring it lifts Cognitive Complexity from 2.5 to about 4.0/10.
Detailed fixes: d2_recommendation.md Β· top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 Β· God Classes8.1 / 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 60 MethodTooLong finding(s) in God Classes β start with LiseurDatabase.kt (31), ServerAccountScreen.kt (4), SettingsBackupRepository.kt (2). β One of this dimension's main actionable groups (60 warning-level).
Resolve the 39 FileTooLong finding(s) in God Classes β start with ReaderScreen.kt, LibraryScreen.kt, ReaderViewModel.kt. β One of this dimension's main actionable groups (39 warning-level).
Resolve the 20 ClassTooLong finding(s) in God Classes β start with ReaderViewModel.kt, LiseurSyncPositionSync.kt, SettingsBackupRepository.kt. β One of this dimension's main actionable groups (20 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.
103 duplicated block group(s) detected. 2.9 % of the production lines (4,453 of 151,071) are in a reported copy. A further 92 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 82 more group(s) β more in Appendix A; the complete list is findings.md.
What to do
Resolve the 12 Duplicated block (7 lines × 2) finding(s) in Code Duplication β start with KoboSyncRepository.kt (2), RecapScheduler.kt, BookOrbitPositionAgreement.kt. β One of this dimension's main actionable groups (12 warning-level).
Resolve the 10 Duplicated block (9 lines × 2) finding(s) in Code Duplication β start with LibraryScreen.kt (2), CompanionSheet.kt, Investigation.kt. β One of this dimension's main actionable groups (10 warning-level).
Resolve the 9 Duplicated block (5 lines × 2) finding(s) in Code Duplication β start with BookOrbitPositionAgreement.kt, AnnotationBackupRepository.kt, LocalLibraryRepository.kt. β One of this dimension's main actionable groups (9 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.
2 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; 0 module(s) off the main sequence.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class β the population is all types, not a name convention.
Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) β start with MlKitTranslationTest.kt, GeminiTranslationTest.kt. β One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d6_recommendation.md Β· top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D11 Β· Test Reliability10.0 / 10Exemplaryβ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
This repository's Gradle dependency graph was RESOLVED BY A BUILD, across every subproject rather than the root alone: 418 artifact(s) resolved, 193 of them gradable against Maven Central, and 124 behind a shipped release. Where a version was requested and a different one won conflict resolution, the RESOLVED version is what is graded β grading the request would recommend an upgrade already applied. Known CVEs in the same graph are a separate question again, reported under D30.
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.
Secret scan ran and found no leaked secrets. 3 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.
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 19 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 3 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. 6 further coordinate(s) are declared with no version at the declaration site β inherited from a parent POM, a BOM or an unresolved Gradle version reference β and are NOT graded: this verdict covers what the checkout pins, not the full transitive graph. A further 25 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. β COVERAGE OF THIS VERDICT: it grades this repository's JVM dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass β a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex β the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt (217×523=113491); app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt (98×64=6272); app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt (62×95=5890) Repeated repair below the complexity floor: app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt (25 of 32 changes were fixes); app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt (18 of 29 changes were fixes); app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsZipBackupUi.kt (17 of 22 changes were fixes)
Resolve the 56 Repeated repair finding(s) in Churn × Complexity Hotspots β start with LocalLibraryRepository.kt, ReadingProgress.kt, SettingsZipBackupUi.kt. β One of this dimension's main actionable groups (56 warning-level).
Resolve the 50 Hotspot finding(s) in Churn × Complexity Hotspots β start with ReaderScreen.kt, MainActivity.kt, LibraryScreen.kt. β One of this dimension's main actionable groups (50 warning-level).
Detailed fixes: d15_recommendation.md Β· top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code β TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
0 deducted task-comment markers across 151071 LoC (0.0/KLoC) β score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
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.
4 of 74 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
ADR still proposed, but the code already adopted it Β· Γ2docs/adr/0003-read-aloud-tts.md:3detected by adr-integrity
ADR declares no statusdocs/adr/0039-the-widget-borrows-the-dashboards-other-devices.md:1detected by adr-integrity
ADR has no Consequences sectiondocs/adr/0066-choosing-an-opds-download-format.md:1detected by adr-integrity
β On the Gold path β maintain.
Detailed fixes: d20_recommendation.md Β· top locations in Appendix A, every location in findings.md.
What it measures: Whether the code actually follows the decisions recorded in the project's ADRs.
Method: Each binding ADR read for checkable forms: a backticked element its Decision section rules out, a ruled-out package the manifests declare, a forbidden module dependency, an opt-in adr-rules block, and a declared delivery status the code does not yet carry. A prose decision with no checkable form is unverifiable, neither a finding nor a pass. Deterministic, no model. Advisory.
0 of 1 checkable records are broken by the code or by their own declared delivery (1 of 55 binding records state a rule in checkable form or declare their delivery; prose decisions are unverifiable).
1 of 3 build units (Gradle, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesionapp/build.gradle.kts:1
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion β start with build.gradle.kts. β One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md Β· top locations in Appendix A, every location in findings.md.
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.
35 % of calls cross a namespace and 16 % 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).
13 finding(s): 0 critical, 3 high, 7 medium, 3 low. semgrep hit a parse error in 4 file(s) β `.claude/skills/r8-analyzer/references/CONFIGURATION-ANALYZER.md`, `app/src/main/kotlin/com/chmouel/liseur/data/liseursync/AnnotationWire.kt` (line 118, line 167, line 202), `gradlew` (line 74, line 178), `hack/promo-clips` (line 91) β so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 4 more group(s) β more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) β start with REDACTED. β One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) β start with REDACTED. β One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) β start with REDACTED. β One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d29_recommendation.md Β· top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares β Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 2 High CVE finding(s) in Dependency Vulnerabilities β start with REDACTED (2). β One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Low vulnerability finding(s) in Dependency Vulnerabilities β start with REDACTED. β One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d30_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.
Every significant source file has living knowledge β recently and meaningfully worked. Counted over 486 of the 625 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 5 Change coupling finding(s) in Change Coupling β start with ReaderViewModel.kt (2), AppContainer.kt, RemoteServer.kt. β One of this dimension's main actionable groups (5 warning-level).
Resolve the 3 Change-coupling hub finding(s) in Change Coupling β start with MainActivity.kt, ReaderActivity.kt, LiseurSyncApi.kt. β One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md Β· top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity β generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals β generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions β scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing β start with REDACTED. β One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. β One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. β One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md Β· top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable β a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it β a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON β the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates β no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged β `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on β and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads β never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 44 dependency declaration(s). This dimension reads what the repository says about ITSELF β a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
β On the Gold path β maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS Β· M = Maturity Β· P = Readiness.
AC1 Β· Text alternatives3.9 / 10Weakβ Tool-verified
Other Β· Accessibility β Whether non-text content carries a text alternative β img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements β img, area, input[type=image], svg, video, object, embed, canvas β across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script β tagged-template (html`β¦`) UIs and hyperscript DOM factories β is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt β alt="" if it's purely decorative. (×3) β promo/thumbnail.html:21, promo/thumbnail.html:25, promo/thumbnail.html:26
What to do
Add a text alternative β alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Other Β· Accessibility β Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks β lang, title, single main landmark β fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script β tagged-template (html`β¦`) UIs and hyperscript DOM factories β is not read at all.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×2) β promo/feature-graphic.html:3, promo/thumbnail.html:3
A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. (×2) β promo/feature-graphic.html:3, promo/thumbnail.html:3
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×2) β promo/feature-graphic.html:3, promo/thumbnail.html:3
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other Β· Accessibility β Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast β PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL β only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) β computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script β tagged-template (html`β¦`) UIs and hyperscript DOM factories β is not read at all.
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.
`CompanionRecapDao` declares 44 abstract methods: `recaps`, `watchRecaps`, `recap`, `touch`, `putRecap`, `firstBackupPage`, `nextBackupPage`, `restoreRecap`, `forgetOtherRecaps`, `parts`, `putPart`, `forgetParts`, `forgetOtherParts`, `queued`, `enqueue`, `dequeue`, `forgetOtherQueued`, `clearQueueFollowingSettings`, `turnedOn`, `choice`, `putChoice`, `summary`, `summariesAt`, `touchSummary`, `putSummary`, `restoreSummary`, `forgetOtherSummaries`, `forgetSummaries`, `summaryCount`, `summaryCharacters`, `oldestSummaries`, `forgetSummary`, `firstSummaryPage`, `nextSummaryPage`, `books`, `forgetRecaps`, `forgetQueued`, `forgetChoices`, `recapCount`, `recapCharacters`, and 4 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:102
`BookDao` declares 60 abstract methods: `observeAll`, `allOnce`, `observeMostRecent`, `mostRecentlyOpened`, `continuationCandidates`, `getByUrl`, `observeByUrl`, `getByUrls`, `presentUrls`, `worksByUrl`, `setArchived`, `allRemote`, `fromBrowseServer`, `observeFromBrowseServer`, `undownloadedFromBrowseServer`, `unlinkDownloadedFromBrowseServerRows`, `forgetUnlinkedCatalogMetadata`, `moveToBrowseServer`, `rescopeRemote`, `moveRemoteToBrowseServer`, `allOpenable`, `remoteNotDownloadedUrls`, `unlinkDownloadedFromRemoteRows`, `unlinkFromRemoteRows`, `markCatalogMissing`, `clearCatalogMissing`, `booksForSource`, `setDownloadState`, `markDownloaded`, `updateAuthor`, `needingAuthorCheck`, `refreshIndexedFile`, `needingSeriesCheck`, `needingMetadataCheck`, `setFileMetadataChecked`, `fillSeriesFromFile`, `setSeriesOverride`, `acknowledgeSeriesClaim`, `updatePendingSeriesClaimRevision`, `pendingSeriesClaims`, and 20 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. β app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:279
`LiseurDatabase` declares 31 abstract methods: `readingProgressDao`, `furthestPositionDao`, `readingSessionDao`, `syncPeerStateDao`, `workIdentityDao`, `bookDao`, `seriesOrderDao`, `libraryFolderDao`, `remoteServerDao`, `kosyncPeerDao`, `annotationDao`, `annotationSyncDao`, `typographyDao`, `bookScreenDao`, `bookReadingModeDao`, `seriesExtraDao`, `uploadRefusalDao`, `sessionRefusalDao`, `sessionTransmissionDao`, `starterCatalogProgressDao`, `bookOrbitBindingDao`, `bookOrbitCfiDao`, `bookOrbitLocalCfiDao`, `bookOrbitPositionAgreementDao`, `bookOrbitPositionTraversalDao`, `bookOrbitStatusAgreementDao`, `remoteStatsDao`, `bookAiPreferencesDao`, `glossaryDao`, `bookMetadataDao`, `sessionImportSourceDao`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. β app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:51
`ReadingProgressDao` declares 31 abstract methods: `forget`, `get`, `resetPeak`, `adoptBookOrbitPosition`, `observe`, `getAll`, `firstBackupPage`, `nextBackupPage`, `restoreBackupReadAt`, `restoreBackupCoverage`, `observeReadAt`, `readAtOnce`, `observeProgressions`, `upsert`, `updateLocal`, `insertLocal`, `updatePending`, `insertPending`, `pendingFor`, `clearPending`, `currentRevision`, `renameRevision`, `renameStatusRevision`, `updateFinishedOverride`, `insertFinishedOverride`, `overrideFor`, `retireAccountState`, `retireStatusDebt`, `rekeyAccount`, `markDirtyFor`, `ownedByOther`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. β app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt:205
`ReadingSessionDao` declares 25 abstract methods: `insert`, `insertAll`, `checkpoint`, `finish`, `openSessions`, `closeInterruptedSessions`, `get`, `observeAll`, `allOnce`, `closedForBackup`, `startedAtFor`, `idFor`, `rowById`, `importedRowsUnder`, `deleteById`, `reattachImportedSessions`, `observeTotalDuration`, `awaitingUpload`, `awaitingUploadTo`, `markUploaded`, `forgetUploads`, `forgetTransmissionEvidence`, `countForBook`, `deleteForBook`, `deleteForBooks`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. β app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingSession.kt:82
`RemoteServerDao` declares 19 abstract methods: `observe`, `get`, `setPreferredFormat`, `observeBrowseServers`, `browseServers`, `nextBrowseId`, `upsert`, `setKoboTokenCipher`, `setCatalogSyncedAt`, `setPositionSyncedAt`, `setSyncToken`, `setCanDownload`, `setCanUpload`, `setCanReadInsights`, `setSyncCursor`, `rotateOrbitTokens`, `setOrbitEpoch`, `setAnnotationCursor`, `delete`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. β app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteServer.kt:332
`SyncPeerStateDao` declares 27 abstract methods: `get`, `hasPendingStatusForBook`, `forPeer`, `pendingFor`, `countPending`, `countForBook`, `upsert`, `updatePending`, `insertPending`, `clearPending`, `updatePendingStatus`, `insertPendingStatus`, `clearPendingStatus`, `updateStatusSent`, `insertStatusSent`, `clearStatusSent`, `acknowledgePositionRevision`, `insertPositionAcknowledgement`, `acknowledgeStatus`, `insertStatusAcknowledgement`, `updateSettled`, `insertSettled`, `forget`, `forgetBooks`, `forgetPeer`, `countForPeer`, `rekeyPeer`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. β app/src/main/kotlin/com/chmouel/liseur/data/db/SyncPeerState.kt:101
`WorkIdentityDao` declares 28 abstract methods: `fingerprint`, `observeFingerprint`, `upsert`, `alias`, `observeAwaitingAnswer`, `reject`, `observeAmbiguityCount`, `aliasesFor`, `observeAliases`, `deleteAliasIfStale`, `confirm`, `markSeeded`, `markAnnotationsReconciled`, `raiseFurthestFloor`, `furthestFloor`, `forgetAnnotationReconciliation`, `ambiguitiesFor`, `ambiguityCount`, `clearAmbiguity`, `forgetFingerprints`, `forgetAliases`, `namingCountForBook`, `forgetAmbiguities`, `forgetPeerAliases`, `forgetPeerAmbiguities`, `countForPeer`, `rekeyAliases`, `rekeyAmbiguities`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. β app/src/main/kotlin/com/chmouel/liseur/data/db/WorkIdentity.kt:147
`TranslatedSentenceDao` declares 23 abstract methods: `find`, `findAll`, `touch`, `put`, `putPulled`, `refreshPulled`, `unsynced`, `lastSaved`, `maxSavedAt`, `count`, `cacheCount`, `cacheCharacters`, `keptBytes`, `forExport`, `exportPage`, `counted`, `characters`, `oldest`, `drop`, `dropOldest`, `books`, `forget`, `clear`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. β app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.kt:73
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
C1 Β· Data Protection3.5 / 10Weakβ Tool-verified
Other Β· Security β Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
What to do
Strengthen data-at-rest protection: vault your keys (AWS KMS / Secrets Manager, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault β not a key compiled into the app) and encrypt the store that holds the personal data (SQLCipher, a Realm encryptionKey, field-level AEAD) β partial coverage still leaves gaps.
Enforce HTTPS on the server that receives this data: terminate TLS in it (Ktor's sslConnector, Spring's server.ssl and requiresSecure, Netty's SslContextBuilder.forServer) and send Strict-Transport-Security (Ktor's HttpsRedirect), or run it behind a TLS-terminating proxy, so data in transit is always encrypted.
Do you agree with this assessment?
C4 Β· Data Retention6.5 / 10Adequateβ Tool-verified
Other Β· Security β Whether data has a defined lifetime β retention periods, TTLs, cleanup jobs (storage limitation).
Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.
A retention mechanism is present, but the data-lifecycle is not yet complete β missing: a scheduled purge / cleanup job (a periodic worker or scheduled task that deletes rows past their retention β @Query("DELETE β¦ WHERE createdAt < :cutoff"), deleteWhere { createdAt less cutoff }, purgeExpiredβ¦ / deleteOldβ¦), a documented retention period / data-expiry.
What to do
Complete the data-lifecycle story: an expiry limit (a declared maximum age for the stored data β a retention-age setting, or a store-level TTL where your storage offers one), a scheduled purge/cleanup job that enforces it, and a documented retention period covering the personal data.
Do you agree with this assessment?
DM10 Β· One transaction, one aggregate10.0 / 10Exemplaryβ Nothing flagged
Other Β· Domain Modelling β Whether a single operation mutates more than one aggregate root. An aggregate is a consistency boundary, so saving two together fuses them into one β the second's invariants come to depend on the first's transaction, and the pair can no longer be separated. Reads of other aggregates are not counted.
Method: Neutral body surface (DDD-gated): every method body scanned for repository WRITE calls (Add/Update/Save/Remove/Delete/Insert/Store and their async forms), keyed on the ARGUMENT type rather than the repository type β three `IRepository<T>` writes collapse to one repository but are three distinct aggregates. Reads (Get/Find/Load/Query) are excluded, so loading another aggregate for context never counts. Score is offending methods over methods that write at all. Deterministic.
Other Β· Domain Modelling β Whether an aggregate can be constructed in a state its own rules forbid β a public constructor that takes a raw primitive, stores it, and validates nothing, with no factory beside it. A constructor taking only value objects is not counted: each parameter has already validated itself.
Method: Neutral surface (DDD-gated): each non-abstract entity/aggregate checked for a PUBLIC constructor taking at least one RAW PRIMITIVE parameter whose body contains no guard token (throw / Guard. / Ensure. / ArgumentException / CheckRule / an XException.ThrowIf* helper). C#: a static factory beside a public constructor does not exempt it, and a public parameterless constructor followed by public raw-primitive setters that refuse nothing is charged when the type also declares a validating way in (a guarded constructor or a guarding static method returning the type); TypeScript: a static Create/Of/From/New factory exempts the type. A constructor taking only value objects is never charged -- measured: 64 of 87 unguarded public constructors on the C# corpus take value objects only, so ignoring parameter types would be 73% false positives. One finding per entity. Deterministic.
`CodexBookRow`'s public constructor takes `bookUrl`, `identity` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `CodexBookRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/companion/CodexStore.kt:20
`CodexUnitRow`'s public constructor takes `bookUrl`, `stats` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `CodexUnitRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/companion/CodexStore.kt:27
`CodexPassageRow`'s public constructor takes `bookUrl`, `ref`, `text`, `folded`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `CodexPassageRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/companion/CodexStore.kt:30
`ChapterRecapRow`'s public constructor takes `bookUrl`, `unitKey`, `contentSha`, `serverId`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `ChapterRecapRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:32
`RecapPartRow`'s public constructor takes `bookUrl`, `unitKey`, `contentSha`, `serverId`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `RecapPartRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:47
`RecapQueueRow`'s public constructor takes `bookUrl`, `unitKey`, `contentSha` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `RecapQueueRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:62
`StorySummaryRow`'s public constructor takes `bookUrl`, `key`, `contentSha`, `deps`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `StorySummaryRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:77
`RecapChoiceRow`'s public constructor takes `bookUrl` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `RecapChoiceRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:96
`AnnotationSync`'s public constructor takes `id`, `peerId`, `bookId`, `workId`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AnnotationSync` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/AnnotationSync.kt:38
`Book`'s public constructor takes `url`, `title`, `author`, `coverPath`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `Book` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:50
`LibraryFolder`'s public constructor takes `url` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `LibraryFolder` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:1118
`BookAiPreferences`'s public constructor takes `bookUrl`, `translationDirection`, `narrationDirection` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookAiPreferences` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookAiPreferences.kt:12
`BookAnnotation`'s public constructor takes `id`, `bookId`, `kind`, `locatorJson`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookAnnotation` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookAnnotation.kt:31
`BookMetadata`'s public constructor takes `bookUrl`, `source`, `subtitle`, `description`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookMetadata` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookMetadata.kt:41
`BookOrbitBinding`'s public constructor takes `accountKey`, `bookUrl`, `fileFormat`, `fileName`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitBinding` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitBinding.kt:38
`BookOrbitCfiRecord`'s public constructor takes `accountKey`, `bookUrl`, `rawCfi` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitCfiRecord` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitCfiRecord.kt:24
`BookOrbitLocalCfi`'s public constructor takes `accountKey`, `bookUrl`, `locatorJson`, `rawCfi` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitLocalCfi` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitLocalCfi.kt:32
`BookOrbitPositionAgreement`'s public constructor takes `accountKey`, `bookUrl`, `baseUrl`, `agreedLocatorJson`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitPositionAgreement` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionAgreement.kt:25
`BookOrbitPositionTraversal`'s public constructor takes `accountKey`, `baseUrl`, `afterUrl`, `failure` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitPositionTraversal` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionTraversal.kt:12
`BookOrbitPositionTraversalItem`'s public constructor takes `accountKey`, `bookUrl` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitPositionTraversalItem` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionTraversal.kt:34
`BookOrbitStatusAgreement`'s public constructor takes `accountKey`, `bookUrl`, `baseUrl`, `agreedRemoteStatus`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitStatusAgreement` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitStatusAgreement.kt:24
`BookReadingMode`'s public constructor takes `bookUrl` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookReadingMode` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookReadingMode.kt:26
`BookScreen`'s public constructor takes `bookUrl` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookScreen` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookScreen.kt:26
`BookTypography`'s public constructor takes `bookUrl`, `font`, `fontSize`, `lineHeight`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookTypography` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookTypography.kt:29
`FurthestPosition`'s public constructor takes `peerId`, `workId`, `edition`, `origin`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `FurthestPosition` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/FurthestPosition.kt:14
`PeakDelivery`'s public constructor takes `peerId`, `bookUrl`, `workId`, `sentOp` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `PeakDelivery` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/FurthestPosition.kt:35
`GlossaryEntry`'s public constructor takes `bookUrl`, `term`, `aliases`, `translation`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `GlossaryEntry` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/GlossaryEntry.kt:24
`KosyncPeer`'s public constructor takes `baseUrl`, `username`, `keyCipher` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `KosyncPeer` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/KosyncPeer.kt:28
`ReadingProgress`'s public constructor takes `bookUrl`, `locatorJson`, `totalProgression`, `readingSpeed`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `ReadingProgress` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt:44
`ReadingSession`'s public constructor takes `bookUrl`, `startProgression`, `endProgression` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `ReadingSession` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingSession.kt:30
`RemoteServer`'s public constructor takes `baseUrl`, `catalogUrl`, `username`, `passwordCipher`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `RemoteServer` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteServer.kt:33
`RemoteStatsDay`'s public constructor takes `accountKey`, `date`, `zone` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `RemoteStatsDay` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteStats.kt:19
`RemoteStatsWindow`'s public constructor takes `accountKey`, `rangeId`, `fromDate`, `today`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `RemoteStatsWindow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteStats.kt:30
`SeriesExtra`'s public constructor takes `seriesId`, `summary`, `status` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `SeriesExtra` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/SeriesExtra.kt:24
`SessionImportSource`'s public constructor takes `archivedUrl` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `SessionImportSource` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/SessionImportSource.kt:33
`SessionRefusal`'s public constructor takes `peerId`, `wireSessionId`, `code` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `SessionRefusal` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/SessionRefusal.kt:39
`SessionTransmission`'s public constructor takes `peerId`, `deviceId`, `payload` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `SessionTransmission` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/SessionTransmission.kt:24
`StarterCatalogProgress`'s public constructor takes `accountKey`, `catalogUrl`, `queueJson`, `seenJson` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `StarterCatalogProgress` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/StarterCatalogProgress.kt:22
`SyncPeerState`'s public constructor takes `bookUrl`, `peerId`, `agreedProgression`, `agreedStatus`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `SyncPeerState` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/SyncPeerState.kt:37
`UploadRefusal`'s public constructor takes `bookUrl`, `accountKey`, `kind`, `reason`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `UploadRefusal` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. β app/src/main/kotlin/com/chmouel/liseur/data/db/UploadRefusal.kt:47
What to do
Give each aggregate one way in that can refuse β a guarded constructor, value-object parameters that validate themselves, or a private constructor behind a factory that returns a failure.
Do you agree with this assessment?
DM12 Β· Ambient inputs in the domain10.0 / 10Exemplaryβ Nothing flagged
Other Β· Domain Modelling β Whether domain types receive the time and randomness their rules depend on, rather than reading the process clock or a global random source directly β an ambient read makes the rule it feeds untestable at the instant that matters and lets two reads inside one operation disagree.
Method: Roslyn (DDD-gated, C#/VB only): domain-layer types scanned for ambient reads β DateTime/DateTimeOffset.Now/UtcNow/Today, Random.Shared, new Random(), Stopwatch.GetTimestamp β resolved against the semantic model, with a comment/string-stripped token fallback only where resolution fails. Body reads are scored; field/property initialisers are surfaced unscored. Apply/When folds excluded (ES1 owns them). Deterministic, symbol-resolved.
Other Β· Domain Modelling β How much of the domain uses strongly-typed ids vs raw Guid/string/int β adoption curve, not all-or-nothing.
Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct β a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.
Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically β non-suffixed identifiers are not seen.
`ChapterRecapRow.unitKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:34
`ChapterRecapRow.serverId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:37
`RecapPartRow.unitKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:49
`RecapPartRow.serverId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:53
`RecapQueueRow.unitKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:64
`AnnotationSync.peerId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/AnnotationSync.kt:40
`AnnotationSync.bookId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/AnnotationSync.kt:42
`AnnotationSync.workId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/AnnotationSync.kt:43
`Book.browseServerId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:75
`Book.remoteBookId` is a raw `Int` β give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:76
`Book.workId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:93
`Book.seriesId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:142
`Book.catalogFolderId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:162
`Book.shelfSeriesId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:252
`BookAnnotation.bookId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookAnnotation.kt:33
`BookOrbitBinding.accountKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitBinding.kt:39
`BookOrbitBinding.bookId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitBinding.kt:43
`BookOrbitBinding.fileId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitBinding.kt:45
`BookOrbitCfiRecord.accountKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitCfiRecord.kt:25
`BookOrbitCfiRecord.bookId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitCfiRecord.kt:27
`BookOrbitCfiRecord.fileId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitCfiRecord.kt:28
`BookOrbitLocalCfi.accountKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitLocalCfi.kt:33
`BookOrbitLocalCfi.bookId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitLocalCfi.kt:35
`BookOrbitLocalCfi.fileId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitLocalCfi.kt:36
`BookOrbitPositionAgreement.accountKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionAgreement.kt:26
`BookOrbitPositionAgreement.bookId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionAgreement.kt:28
`BookOrbitPositionAgreement.fileId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionAgreement.kt:29
`BookOrbitPositionTraversal.accountKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionTraversal.kt:13
`BookOrbitPositionTraversalItem.accountKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionTraversal.kt:35
`BookOrbitPositionTraversalItem.bookId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionTraversal.kt:37
`BookOrbitPositionTraversalItem.fileId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionTraversal.kt:38
`BookOrbitStatusAgreement.accountKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitStatusAgreement.kt:25
`BookOrbitStatusAgreement.bookId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitStatusAgreement.kt:27
`FurthestPosition.peerId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/FurthestPosition.kt:15
`FurthestPosition.workId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/FurthestPosition.kt:16
`PeakDelivery.peerId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/FurthestPosition.kt:36
`PeakDelivery.workId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/FurthestPosition.kt:38
`KosyncPeer.accountKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/KosyncPeer.kt:56
`RemoteServer.accountId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteServer.kt:55
`RemoteServer.userId` is a raw `Int` β give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that. β app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteServer.kt:56
What to do
Adopt strongly-typed ids across the domain β finish the migration or document the boundary; primitive ids invite transposed-argument bugs.
Do you agree with this assessment?
DM4 Β· Rich vs anemic model3.0 / 10Weakβ Tool-verified
Other Β· Domain Modelling β Whether aggregates/entities carry the behaviour that protects their invariants, rather than being data bags driven by external services.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query β only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query β logic-bearing domain types outside the convention are invisible.
`CodexBookRow` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/companion/CodexStore.kt:20
`CodexUnitRow` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/companion/CodexStore.kt:27
`CodexPassageRow` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/companion/CodexStore.kt:30
`ChapterRecapRow` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:32
`RecapPartRow` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:47
`RecapQueueRow` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:62
`StorySummaryRow` is an aggregate/entity with 13 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:77
`RecapChoiceRow` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:96
`AnnotationSync` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/AnnotationSync.kt:38
`Book` is an aggregate/entity with 52 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:50
`LibraryFolder` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:1118
`BookAiPreferences` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookAiPreferences.kt:12
`BookAnnotation` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookAnnotation.kt:31
`BookMetadata` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookMetadata.kt:41
`BookOrbitBinding` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitBinding.kt:38
`BookOrbitCfiRecord` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitCfiRecord.kt:24
`BookOrbitLocalCfi` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitLocalCfi.kt:32
`BookOrbitPositionAgreement` is an aggregate/entity with 24 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionAgreement.kt:25
`BookOrbitPositionTraversal` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionTraversal.kt:12
`BookOrbitPositionTraversalItem` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionTraversal.kt:34
`BookOrbitStatusAgreement` is an aggregate/entity with 18 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitStatusAgreement.kt:24
`BookReadingMode` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookReadingMode.kt:26
`BookScreen` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookScreen.kt:26
`BookTypography` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/BookTypography.kt:29
`FurthestPosition` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/FurthestPosition.kt:14
`PeakDelivery` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/FurthestPosition.kt:35
`KosyncPeer` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/KosyncPeer.kt:28
`ReadingProgress` is an aggregate/entity with 44 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt:44
`ReadingSession` is an aggregate/entity with 13 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingSession.kt:30
`RemoteServer` is an aggregate/entity with 36 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteServer.kt:33
`RemoteStatsDay` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteStats.kt:19
`RemoteStatsWindow` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteStats.kt:30
`SeriesExtra` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/SeriesExtra.kt:24
`SessionImportSource` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/SessionImportSource.kt:33
`SessionRefusal` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/SessionRefusal.kt:39
`SessionTransmission` is an aggregate/entity with 4 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/SessionTransmission.kt:24
`StarterCatalogProgress` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/StarterCatalogProgress.kt:22
`SyncPeerState` is an aggregate/entity with 23 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/SyncPeerState.kt:37
`UploadRefusal` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/UploadRefusal.kt:47
`BookFingerprintRow` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service. β app/src/main/kotlin/com/chmouel/liseur/data/db/WorkIdentity.kt:25
What to do
Move business rules onto the aggregates/entities they govern so invariants are enforced at the source, not in anemic services.
Other Β· Domain Modelling β Whether entities protect their state β private/init-only setters, and collections handed out as read-only views rather than the mutable backing collection β instead of exposing writable state that bypasses invariants. Softened when a rehydration framework (Marten/EF) is present.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state β public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other Β· Domain Modelling β Whether the domain layer stays free of infrastructure dependencies (EF/Marten/HTTP/ASP.NET) β the clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES β resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES β rename the layer and the check evaporates.
Other Β· Domain Modelling β Whether one domain rule is decided β or one measurement produced β in more than one place, rather than living on the type that owns it.
Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type β operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of β₯2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own β the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.
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.
Maturity Β· Maturity β Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity Β· Maturity β Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Readiness Β· Readiness β Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step β in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 4 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen β if that is your case the row is wrong, and saying so is more useful than adding a second scanner. β REDACTED:6
`REDACTED` schedules updates, but no `package-ecosystem` entry covers `npm`, which this tree depends on β so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list. β REDACTED:2
What to do
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs β or `semgrep --config=auto`, which runs on any language β so a security regression fails the build instead of landing.
Dependabot is configured but does not watch `npm` β add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness Β· Readiness β Whether releases are automated and safely reversible (probes, rolling updates, approval gates) β from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
What to do
Make sure a person approves each release. The release job names an environment, but its approval rules live in the code host's settings, where we can't see them. Check that a reviewer must approve each release, or publish releases as drafts first, so a bad build can be stopped before anyone downloads it.
Do you agree with this assessment?
P5 Β· DR & Backup4.0 / 10Weakβ Tool-verified
Readiness Β· Readiness β Whether disaster recovery is planned and codified β backups, geo-recovery, RTO/RPO, persistence guarantees β from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Readiness Β· Performance β Whether asynchronous code stays responsive β it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere β .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect β and, for a .NET library with β₯5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
R1 Β· Type Safety10.0 / 10Exemplaryβ Tool-verified
React / JS Β· Code Health β How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
React / JS Β· Code Health β The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines β so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own β or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
promo/src/scenes/companion.tsx:5 · promo/src/scenes/library.tsx:5 · promo/src/scenes/outro.tsx:3 · promo/src/scenes/reading.tsx:5 β the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block β it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead β the whole function, component or branch these lines sit in β and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. β promo/src/scenes/companion.tsx:5
promo/src/scenes/aloud.tsx:3 · promo/src/scenes/companion.tsx:3 · promo/src/scenes/library.tsx:3 · promo/src/scenes/reading.tsx:3 β the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block β it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead β the whole function, component or branch these lines sit in β and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. β promo/src/scenes/aloud.tsx:3
promo/src/scenes/companion.tsx:5 · promo/src/scenes/intro.tsx:3 · promo/src/scenes/library.tsx:5 · promo/src/scenes/outro.tsx:3 · +2 more site(s) not listed β the 6 copies are spread across 6 files, and the CITED SPAN is not a self-contained block β it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead β the whole function, component or branch these lines sit in β and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. β promo/src/scenes/companion.tsx:5
promo/src/scenes/intro.tsx:6 · promo/src/scenes/outro.tsx:6 β the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block β it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead β the whole function, component or branch these lines sit in β and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. β promo/src/scenes/intro.tsx:6
promo/src/scenes/intro.tsx:2 · promo/src/scenes/sync.tsx:4 · promo/src/scenes/translation.tsx:3 β the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block β it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead β the whole function, component or branch these lines sit in β and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. β promo/src/scenes/intro.tsx:2
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory β sometimes there is nothing to extract.
React / JS Β· Code Health β Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) β real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
Do you agree with this assessment?
R3 Β· Large Files10.0 / 10Exemplaryβ Tool-verified
React / JS Β· Code Health β How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
React / JS Β· Readiness β How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
Do you agree with this assessment?
R6 Β· Tooling10.0 / 10Exemplaryβ Tool-verified
React / JS Β· Readiness β Whether the project wires up test, lint and typecheck β detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 Β· Dead Code10.0 / 10Exemplaryβ Tool-verified
React / JS Β· Code Health β Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
React / JS Β· Readiness β npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps β from the manifest + import graph. Deterministic.
Declared in promo/package.json but never imported anywhere in that package or its workspace members β no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×2) β promo/package.json:26, promo/package.json:19
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS Β· Architecture β Import cycles in the module graph (D-386) β files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other Β· Code Health β Whether 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.
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.
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 document10.0 / 10Exemplaryβ Nothing flagged
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.
Other Β· Code Health β Whether a type's disposal matches what it OWNS β releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer β an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engineβs own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(β¦)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(β¦)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) β a class whose superclass or mixin lies outside the repository is not judged β and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other Β· Code Health β Whether suspend functions that make a cancellable request accept or pass on the coroutine's cancellation (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. 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 question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 0/15 suspend functions that make a cancellable request (Ktor, OkHttp newCall, URL streams) accept the coroutine's cancellation or pass one on, so a request keeps running after whatever wanted it has given up β a screen navigated away from, a disposed widget, a superseded search. In a suspend function, make the request with a call that suspends β Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` that cancels the `Call` β not a blocking `execute()`: `withContext(Dispatchers.IO)` moves the call off the caller's thread but does not make it cancellable; where nothing could ever cancel the call, omitting it is a deliberate choice β judge against how the function is used.
`send` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. (×2) β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:183, app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:227
`sendMaybeEmpty` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:199
`upload` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncUploadClient.kt:90
`download` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloader.kt:62
`delete` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/calibre/CalibreDeleteClient.kt:22
`readState` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboClient.kt:78
`pushState` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboClient.kt:113
`exchange` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:75
`stream` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:106
`mutate` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:140
`getObjectOrNull` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:191
`postObject` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:204
`get` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:246
`me` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitSetupClient.kt:195
What to do
Thread the coroutine's cancellation through suspend functions that make requests, so the work stops when its caller gives up.
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.
Other Β· Code Health β Whether a value the caller is invited to supply is the value the type actually uses β a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engineβs own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 Β· Collection changed while being enumerated10.0 / 10Exemplaryβ Nothing flagged
Other Β· Code Health β Whether a `for (x in c)` or `c.forEach { β¦ }` leaves the collection it is walking alone β a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/β¦) on the very expression the loop is enumerating. Two arms. ARM A β the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B β the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
X29 Β· Per-element action decided by a fixed element10.0 / 10Exemplaryβ Nothing flagged
Other Β· Code Health β Whether a decision taken once per element is taken ABOUT that element β a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`βs condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move β written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engineβs own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = β¦; β¦; β¦)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
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. (×3) β app/src/play/kotlin/com/chmouel/liseur/insights/FlavorUsageReporting.kt:146, app/src/play/kotlin/com/chmouel/liseur/insights/FlavorUsageReporting.kt:152, app/src/main/kotlin/com/chmouel/liseur/translate/DeviceTranslationService.kt:258
`catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×23) β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:320, app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryViewModel.kt:1478, app/src/main/kotlin/com/chmouel/liseur/tts/KeyCommits.kt:46, β¦
`catch (_: RuntimeException)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) β app/src/main/kotlin/com/chmouel/liseur/translate/DeviceTranslationService.kt:271, app/src/main/kotlin/com/chmouel/liseur/translate/DeviceTranslationService.kt:293
`catch (e: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) β app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:1007, app/src/main/kotlin/com/chmouel/liseur/readaloud/PausedListening.kt:105
`catch (refused: 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. (×3) β app/src/main/kotlin/com/chmouel/liseur/reader/SelectionHandleFix.kt:299, app/src/main/kotlin/com/chmouel/liseur/reader/footnotes/FootnoteLayout.kt:389, app/src/main/kotlin/com/chmouel/liseur/reader/footnotes/SameDocumentLinks.kt:138
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.
Do you agree with this assessment?
WCAG coverage β what static analysis assessed
Statically assessed 11 of 55 WCAG 2.2 Level A/AA success criteria (20%; β22% of the 50 WCAG 2.1 AA criteria for EN 301 549). A further 2 got runtime (rendered axe-core) evidence this scan: 1.3.1, 2.5.8. The other 42 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim β a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by β¦") and is never the strongest area however high its average.
Unscored β 3 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.
AXR1 Runtime accessibility (rendered) β 2 observation(s) recorded Β· Advisory β this card reports evidence and never carries a score, so there is nothing missing here.
X10 Duplicated predicate β 34 observation(s) recorded Β· Advisory β this card reports evidence and never carries a score.
X7 Silent fallback defaults β 9 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.
C3 Audit Trail β Repo shows no audit-logging mechanism (an audit-log table or model β an Exposed table, a data class, a Room entity or a SQL migration's table named for it β Hibernate Envers' @Audited, a JPA entity listener, Hibernate event listener or jOOQ RecordListener that records each change) for sensitive changes β absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
C5 Data-Subject Rights β Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary β absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
Not included β 58 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.
AC2 Forms & labels β No form control/button found in the parsed markup β AC2 not applicable here.
AC4 Keyboard semantics β No interactive element found in the parsed markup β AC4 not applicable here.
AC5 ARIA correctness β No ARIA usage found in the parsed markup β AC5 not applicable here.
AX1 Captive dependencies β not analysed β these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons β No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
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.
C2 Access Controls β Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository β because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D10 Test Quality β ~88423 lines of test source are present (.kt) but no test cases reached the test census for this repository β no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise β so skipped/assertion-free tests couldn't be counted. Not scored β this is a gap in the analyzer, not a finding about this repository.
D16 Bus Factor β single-maintainer repository β bus factor is not applicable
D18 Solution Shape β D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency β Naming consistency does not read html yet; not measured.
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; comments in this repository's .kt source were not judged.
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) β 53 file(s) were not parsed by semgrep β the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy β No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement β No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement β No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement β No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D8 Code Coverage β Coverage not included β suite not readable by the collector
DM1 Aggregate boundaries β no aggregates detected β aggregate-boundary check not applicable
DM3 Integration-event coupling β no integration events detected β coupling check not applicable
DM7 Repository granularity β no repository abstraction detected (e.g. uses a document session)
DM8 Value-object opportunities β not scored β the deterministic rule found 0 candidate clump(s); its rows are withheld until it has a measured precision of 95 % (a sample of fewer than 10 rows cannot show one)
ED1 Event-Driven β not scored β this repository shows 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 β Reported, not scored β and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P2 Observability β This repository's JVM, JavaScript/TypeScript source (2 module(s), 622 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service β it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
P7 Outbound HTTP resilience β not applicable β no HTTP server, API framework or worker entry point was found in the JVM, JavaScript/TypeScript source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations β no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage β coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here β Test coverage (D8) says why
PF1 Benchmark discipline β Not applicable: no benchmark suite was found. This check searched for `@Benchmark` in a Java, Kotlin or Scala file importing JMH or kotlinx-benchmark, Jetpack Benchmark's `measureRepeated` in a file importing androidx.benchmark, or JMH/kotlinx-benchmark/androidx.benchmark in a pom.xml, Gradle or sbt build, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene β Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries β No recognizable feature-sliced/layered src layout β boundary rules not applicable.
R4 Test Coverage β the JS/TS workspace (17 production file(s)) has no JavaScript/TypeScript test, but it is 0.36% of this repository's production source and the other 99.64% carries 88,423 line(s) of test code this pass cannot read β an incidental frontend's reachability is not the repository's test posture, so it is not scored as one
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.
SC1 Supply-chain hygiene β Advisory β this card reports evidence and never carries a score, so there is nothing missing here.
X13 Undrained process stream β not applicable β the code was read and holds no site of this kind, so there is nothing for this check to judge
X14 Bypassable address classification β not applicable β the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader β not applicable β the code was read and holds no site of this kind, so there is nothing for this check to judge
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
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 β X24 reached only 0% of this repository's production lines β kotlin (150,596 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X26 Unsynchronised callback handoff β not applicable β the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly β This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging β This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Kotlin was read, and it logs through none that an assembled message defeats: Android's `Log` and Timber, java.util.logging and log4j-api-kotlin take one finished message (as log4net does in C#), or it makes no call through a named logger at all. Calls made through SLF4J, log4j 2 or kotlin-logging (`LoggerFactory.getLogger`, `KotlinLogging.logger {}`) would be judged.
X6 Hand-rolled structured-format parsing β Advisory β this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand β Advisory β this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A β Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Critical β 12 finding(s)
AC1 Β· Text alternativesΒ· <img> without a text alternative Β· Γ3
<img> without a text alternative promo/thumbnail.html:21β An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt β alt="" if it's purely decorative.
<img> without a text alternative promo/thumbnail.html:25β An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt β alt="" if it's purely decorative.
<img> without a text alternative promo/thumbnail.html:26β An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt β alt="" if it's purely decorative.
AC3 Β· Page structureΒ· <html> without a lang Β· Γ2
<html> without a lang promo/feature-graphic.html:3β The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang promo/thumbnail.html:3β The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 Β· Page structureΒ· Document without a <title> Β· Γ2
Document without a <title> promo/feature-graphic.html:3β A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
Document without a <title> promo/thumbnail.html:3β A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
D30 Β· Dependency VulnerabilitiesΒ· High CVE Β· Γ2
MethodTooLong: LiseurDatabase.readingProgressDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:56β MethodTooLong β readingProgressDao runs 1206 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1106 over it, 12.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body β the runs of statements that work on the same values and would earn the same name β into its own named unit, and have this one call them in order.
MethodTooLong: LiseurDatabase.furthestPositionDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:57β MethodTooLong β furthestPositionDao runs 1205 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1105 over it, 12.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body β the runs of statements that work on the same values and would earn the same name β into its own named unit, and have this one call them in order.
MethodTooLong: LiseurDatabase.readingSessionDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:58β MethodTooLong β readingSessionDao runs 1204 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1104 over it, 12.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body β the runs of statements that work on the same values and would earn the same name β into its own named unit, and have this one call them in order.
MethodTooLong: LiseurDatabase.syncPeerStateDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:59β MethodTooLong β syncPeerStateDao runs 1203 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1103 over it, 12.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body β the runs of statements that work on the same values and would earn the same name β into its own named unit, and have this one call them in order.
MethodTooLong: LiseurDatabase.workIdentityDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:61β MethodTooLong β workIdentityDao runs 1202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1102 over it, 12.02× 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: LiseurDatabase.bookDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:62β MethodTooLong β bookDao runs 1201 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1101 over it, 12.01× 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: LiseurDatabase.seriesOrderDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:63β MethodTooLong β seriesOrderDao runs 1200 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1100 over it, 12.00× 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: LiseurDatabase.libraryFolderDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:64β MethodTooLong β libraryFolderDao runs 1199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1099 over it, 11.99× 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: LiseurDatabase.remoteServerDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:65β MethodTooLong β remoteServerDao runs 1198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1098 over it, 11.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body β the runs of statements that work on the same values and would earn the same name β into its own named unit, and have this one call them in order.
MethodTooLong: LiseurDatabase.kosyncPeerDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:66β MethodTooLong β kosyncPeerDao runs 1197 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1097 over it, 11.97× 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: LiseurDatabase.annotationDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:67β MethodTooLong β annotationDao runs 1196 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1096 over it, 11.96× 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: LiseurDatabase.annotationSyncDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:68β MethodTooLong β annotationSyncDao runs 1195 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1095 over it, 11.95× 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: LiseurDatabase.typographyDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:69β MethodTooLong β typographyDao runs 1194 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1094 over it, 11.94× 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: LiseurDatabase.bookScreenDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:70β MethodTooLong β bookScreenDao runs 1193 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1093 over it, 11.93× 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: LiseurDatabase.bookReadingModeDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:71β MethodTooLong β bookReadingModeDao runs 1192 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1092 over it, 11.92× 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: LiseurDatabase.seriesExtraDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:72β MethodTooLong β seriesExtraDao runs 1191 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1091 over it, 11.91× 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: LiseurDatabase.uploadRefusalDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:73β MethodTooLong β uploadRefusalDao runs 1190 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1090 over it, 11.90× 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: LiseurDatabase.sessionRefusalDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:74β MethodTooLong β sessionRefusalDao runs 1189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1089 over it, 11.89× 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: LiseurDatabase.sessionTransmissionDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:75β MethodTooLong β sessionTransmissionDao runs 1188 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1088 over it, 11.88× 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: LiseurDatabase.starterCatalogProgressDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:76β MethodTooLong β starterCatalogProgressDao runs 1187 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1087 over it, 11.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body β the runs of statements that work on the same values and would earn the same name β into its own named unit, and have this one call them in order.
MethodTooLong: LiseurDatabase.bookOrbitBindingDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:77β MethodTooLong β bookOrbitBindingDao runs 1186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1086 over it, 11.86× 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: LiseurDatabase.bookOrbitCfiDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:78β MethodTooLong β bookOrbitCfiDao runs 1185 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1085 over it, 11.85× 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: LiseurDatabase.bookOrbitLocalCfiDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:79β MethodTooLong β bookOrbitLocalCfiDao runs 1184 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1084 over it, 11.84× 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: LiseurDatabase.bookOrbitPositionAgreementDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:80β MethodTooLong β bookOrbitPositionAgreementDao runs 1183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1083 over it, 11.83× 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: LiseurDatabase.bookOrbitPositionTraversalDao app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:81β MethodTooLong β bookOrbitPositionTraversalDao runs 1182 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1082 over it, 11.82× 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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:771β app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt changed 32 times in last 90 days and 25 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 LocalLibraryRepository.shelve at line 771), 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: Show a translator with other roles as the translatorβ; βfix: Let a download that lands first keep the bookβ; βfix: Keep stale reads off covers, series and copied idsβ; βfix: Leave a book alone when its file changes during a rereadβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt:1179β app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt changed 29 times in last 90 days and 18 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is ReadingProgressDao.adoptFinishedOverride at line 1179), 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: never reuse a choice's name after an account changesβ; βfix: keep an account's and a recording's edges straightβ; βfix: keep an owed reset and a partial place straightβ; βfix: keep a recording's span with the place it reachedβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsZipBackupUi.kt app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsZipBackupUi.kt:197β app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsZipBackupUi.kt changed 22 times in last 90 days and 17 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is SettingsBackupViewModel.prepareExport at line 197), 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: Keep one copy of a restored reading sittingβ; βfix: Stop restored reading time from counting twiceβ; βfix: Keep the prepared backup when Android restarts the screenβ; βfix: Ignore malformed backup state when Liseur startsβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsZipBackupUi.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloadRepository.kt app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloadRepository.kt:531β app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloadRepository.kt changed 22 times in last 90 days and 14 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is BookDownloadRepository.deleteFromServer at line 531), 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: Stop a refresh or a late file read from describing the wrong copyβ; βfix: Forget a book's file hash when its download is removed or replacedβ; βfix: Tighten a few edge cases around uploads and server deletesβ; βfix: Leave a new account's link alone after a late server deleteβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloadRepository.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/data/library/BookRemoval.kt app/src/main/kotlin/com/chmouel/liseur/data/library/BookRemoval.kt:52β app/src/main/kotlin/com/chmouel/liseur/data/library/BookRemoval.kt changed 20 times in last 90 days and 14 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is BookRemoval.deleteFolder at line 52), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot β the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: βfix: Forget the old file's details when a new download landsβ; βfix: Keep old server details and stale downloads off a relinked bookβ; βfix: Stop a refresh or a late file read from describing the wrong copyβ; βfix: Keep book details true to the book after removals and refreshesβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/library/BookRemoval.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/reader/TranslatedPages.kt app/src/main/kotlin/com/chmouel/liseur/reader/TranslatedPages.kt:268β app/src/main/kotlin/com/chmouel/liseur/reader/TranslatedPages.kt changed 18 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is TranslatedPages.measure at line 268), 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: check the reader page still exists before measuring itβ; βfix: Prevent crashes during scroll-mode changesβ; βfix: Reject stale dictionary lookupsβ; βfix: Show translation attribution and bound lookupsβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/reader/TranslatedPages.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/data/opds/OpdsParser.kt app/src/main/kotlin/com/chmouel/liseur/data/opds/OpdsParser.kt:698β app/src/main/kotlin/com/chmouel/liseur/data/opds/OpdsParser.kt changed 17 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is OpdsParser.blockText at line 698), 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(opds): Read the cover relations older catalogs still useβ; βfix: Never default to a Kobo file and number look-alike formatsβ; βfix: Keep every OPDS format choice reliableβ; βfix: Show an xhtml summary's escaped text as writtenβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/opds/OpdsParser.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.kt app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.kt:776β app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.kt changed 16 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is SavedTranslations.restoreKept at line 776), 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: Ask again before a job runs on a new keyβ; βfix: Ensure whole-book translation pause persists reliablyβ; βfix: Keep account clears from getting stuckβ; βfix: keep cleared translations from returningβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/data/remote/BookUploadWorker.kt app/src/main/kotlin/com/chmouel/liseur/data/remote/BookUploadWorker.kt:31β app/src/main/kotlin/com/chmouel/liseur/data/remote/BookUploadWorker.kt changed 12 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is BookUploadWorker.doWork at line 31), 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: Tighten a few edge cases around uploads and server deletesβ; βfix: Stop retrying uploads that cannot be matched without download rightsβ; βfix: Check a sent book's file again before trusting old linksβ; βfix: Relink sent books after signing back in to BookOrbitβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/remote/BookUploadWorker.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/data/quotes/HomeQuotes.kt app/src/main/kotlin/com/chmouel/liseur/data/quotes/HomeQuotes.kt:512β app/src/main/kotlin/com/chmouel/liseur/data/quotes/HomeQuotes.kt changed 9 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is QuoteScanner.walk at line 512), 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: Check a cached paragraph where it ends, not only where it opensβ; βfix: Keep a hidden book out of Home and check lines by their chapterβ; βfix: Take the ceilng place from the furthest point, not an older peakβ; βfix: Leave a book alone when its ceiling has no place to stop atβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/quotes/HomeQuotes.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/reader/ReaderPreferencesMapper.kt app/src/main/kotlin/com/chmouel/liseur/reader/ReaderPreferencesMapper.kt:59β app/src/main/kotlin/com/chmouel/liseur/reader/ReaderPreferencesMapper.kt changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is ReaderPreferencesMapperKt.toEpubPreferences at line 59), 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: Keep the reader's place when opening notesβ; βfix: Make narrow margins work on tabletsβ; βfix: Keep fixed-layout EPUB pages unchangedβ; βfix: Resize EPUB text with native Android zoomβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/reader/ReaderPreferencesMapper.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:268β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is KoboSyncRepository.run at line 268), 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: Keep an unread reset protected after reading onβ; βfix: Ignore replies from before a restoreβ; βfix: ask each sync partner whether it would dialβ; βfix: Reject stale catch-up accountsβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/ui/LiseurModalBottomSheet.kt app/src/main/kotlin/com/chmouel/liseur/ui/LiseurModalBottomSheet.kt:238β app/src/main/kotlin/com/chmouel/liseur/ui/LiseurModalBottomSheet.kt changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is LiseurModalBottomSheetKt.PopupBack at line 238), 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: Stop sheets bouncing when dragged by the handle or titleβ; βfix: Stop sheets bouncing at the end of a listβ; βfix: Let Back step out of a sheet's inner page on e-ink screensβ; βfix: Open the voice service menu on e-ink readersβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/ui/LiseurModalBottomSheet.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:476β app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is KosyncPositionSync.act at line 476), 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: Keep an unread reset protected after reading onβ; βfix: Stop stale uploads after a pairing restoreβ; βfix: Ignore late replies from old pairingsβ; βfix: ask to reach servers on the home networkβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/ui/library/BookDetailsScreen.kt app/src/main/kotlin/com/chmouel/liseur/ui/library/BookDetailsScreen.kt:293β app/src/main/kotlin/com/chmouel/liseur/ui/library/BookDetailsScreen.kt changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is BookDetailsScreenKt.BookActions at line 293), 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: Stop the continue reading card outliving the unread markβ; βfix: Show a book marked unread as unread everywhereβ; βfix: Stop offering a finished book as a fresh startβ; βfix: Keep stale reads off covers, series and copied idsβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/ui/library/BookDetailsScreen.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/data/settings/SettingsSyncRepository.kt app/src/main/kotlin/com/chmouel/liseur/data/settings/SettingsSyncRepository.kt:72β app/src/main/kotlin/com/chmouel/liseur/data/settings/SettingsSyncRepository.kt changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is SettingsSyncRepository.claimDevice at line 72), 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: Preserve settings edits after lost repliesβ; βfix: restore settings when an account signs in as another deviceβ; βfix: Move phones that copied the old size from another deviceβ; βfix: Judge the new default size per sync accountβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/settings/SettingsSyncRepository.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/reader/NavigatorPositionEvent.kt app/src/main/kotlin/com/chmouel/liseur/reader/NavigatorPositionEvent.kt:66β app/src/main/kotlin/com/chmouel/liseur/reader/NavigatorPositionEvent.kt changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is NavigatorPositionEventKt.classifyNavigatorEmission at line 66), 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: Save the reader's first page turnβ; βfix: Keep deliberate reading choices on pauseβ; βfix: Keep the selected server page on pauseβ; βfix: Keep the reading place you actually reachedβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/reader/NavigatorPositionEvent.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslations.kt app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslations.kt:308β app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslations.kt changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is WholeBookTranslations.execute at line 308), 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: Keep a finished job from stopping the next oneβ; βfix: Wait out a failing server before resumingβ; βfix: Tighten when whole-book translations resumeβ; βfix: Ensure whole-book translation pause persists reliablyβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslations.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/data/library/ReadingPositionBackupRepository.kt app/src/main/kotlin/com/chmouel/liseur/data/library/ReadingPositionBackupRepository.kt:28β app/src/main/kotlin/com/chmouel/liseur/data/library/ReadingPositionBackupRepository.kt changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is ReadingPositionBackupRepository.writeContents at line 28), 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: Keep reading history during recoveryβ; βfix: keep a book's status honest across the edges around itβ; βfix: Refresh finished books after restoring positionsβ; βfix: Keep percentage-only positions in backupsβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/library/ReadingPositionBackupRepository.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesViewModel.kt app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesViewModel.kt:555β app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesViewModel.kt changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is BrowseLibrariesViewModel.prepareCategory at line 555), 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: Leave the old catalog behind when the library opens the chooserβ; βfix: Keep the free catalog chooser from bouncing backβ; βfix(browse): Keep the free-catalog chooser reachable once every preset is savedβ; βfix: Show the Back preview when leaving the catalog browserβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesViewModel.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/reader/chrome/PageTurnEffect.kt app/src/main/kotlin/com/chmouel/liseur/reader/chrome/PageTurnEffect.kt:204β app/src/main/kotlin/com/chmouel/liseur/reader/chrome/PageTurnEffect.kt changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is PageTurner.beginDraggedTurn at line 204), 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: turn every page the same wayβ; βfix: keep a turned page turned when the reader leaves mid-flickβ; βfix: keep the book still while a picture is openβ; βfix(reader): drop a turn's wait when the screenful did not moveβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/reader/chrome/PageTurnEffect.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/domain/SeriesShelf.kt app/src/main/kotlin/com/chmouel/liseur/domain/SeriesShelf.kt:298β app/src/main/kotlin/com/chmouel/liseur/domain/SeriesShelf.kt changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is SeriesShelfKt.arrangedBy at line 298), 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: Stop the continue reading card outliving the unread markβ; βfix: Show a book marked unread as unread everywhereβ; βfix: keep series details in a steady orderβ; βfix: keep duplicate series copies in orderβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/domain/SeriesShelf.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/reader/progress/ExactLocatorAnchor.kt app/src/main/kotlin/com/chmouel/liseur/reader/progress/ExactLocatorAnchor.kt:31β app/src/main/kotlin/com/chmouel/liseur/reader/progress/ExactLocatorAnchor.kt changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is ExactLocatorAnchor.parseJavascriptResult at line 31), 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: Keep the reader's place when opening notesβ; βfix: tell a bookmarked page by its locator, not its page numberβ; βfix(reader): mark where the reader is, not where they were (#82)β; βfix: keep reading position when typography changes (#64)β. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/reader/progress/ExactLocatorAnchor.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslationService.kt app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslationService.kt:57β app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslationService.kt changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is WholeBookTranslationService.onStartCommand at line 57), 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: Keep a finished job from stopping the next oneβ; βfix: Keep translation notices in the app languageβ; βfix: Tighten when whole-book translations resumeβ; βfix: Ensure whole-book translation pause persists reliablyβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslationService.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.
Repeated repair: app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ScrollMovement.kt app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ScrollMovement.kt:80β app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ScrollMovement.kt changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is ScrollMovement.sample at line 80), 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: Keep scrolling and failed saves from upsetting the saved placeβ; βfix: Keep the reader's own scrolling from being ignoredβ; βfix: Do not count showing the toolbar as reading onβ; βfix: Save the reader's first page turnβ. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ScrollMovement.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: app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:447β app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt changed 217 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 523 in ReaderScreenKt.ReaderScreen at line 447. 125 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one β a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.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: app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt:300β app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt changed 98 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in MainActivityKt.LiseurApp at line 300. 20 of those changes were fix/bug commits, and the other 78 changed it for other reasons β this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one β a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/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: app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:204β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt changed 62 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 95 in LibraryScreenKt.LibraryScreen at line 204. 22 of those changes were fix/bug commits, and the other 40 changed it for other reasons β this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one β a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.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: app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:1408β app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt changed 98 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in ReaderViewModel.open at line 1408. 47 of those changes were fix/bug commits, and the other 51 changed it for other reasons β this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one β a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.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: app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1037β app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in SettingsBackupRepository.readArchive at line 1037. 18 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one β a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.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: app/src/main/kotlin/com/chmouel/liseur/reader/ReaderActivity.kt app/src/main/kotlin/com/chmouel/liseur/reader/ReaderActivity.kt:147β app/src/main/kotlin/com/chmouel/liseur/reader/ReaderActivity.kt changed 83 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in ReaderActivity.onCreate at line 147. 28 of those changes were fix/bug commits, and the other 55 changed it for other reasons β this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one β a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/reader/ReaderActivity.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: app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsBackupScreen.kt app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsBackupScreen.kt:69β app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsBackupScreen.kt changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in SettingsBackupScreenKt.SettingsBackupScreen at line 69. 12 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one β a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsBackupScreen.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: app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:1006β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in LiseurSyncPositionSync.name at line 1006. 34 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one β a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.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: app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteAccountRepository.kt app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteAccountRepository.kt:656β app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteAccountRepository.kt changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in RemoteAccountRepository.storeLocked at line 656. 13 of those changes were fix/bug commits, and the other 27 changed it for other reasons β this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one β a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteAccountRepository.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: app/src/main/kotlin/com/chmouel/liseur/companion/CodexSheet.kt app/src/main/kotlin/com/chmouel/liseur/companion/CodexSheet.kt:140β app/src/main/kotlin/com/chmouel/liseur/companion/CodexSheet.kt changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in CodexSheetKt.CodexSheet at line 140. 15 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one β a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/companion/CodexSheet.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: app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:958β app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in ServerAccountScreenKt.ConnectedCard at line 958. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.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: app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudSettingsScreen.kt app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudSettingsScreen.kt:954β app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudSettingsScreen.kt changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in ReadAloudSettingsScreenKt.KeyRow at line 954. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudSettingsScreen.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: app/src/main/kotlin/com/chmouel/liseur/reader/annotations/SelectionPopup.kt app/src/main/kotlin/com/chmouel/liseur/reader/annotations/SelectionPopup.kt:307β app/src/main/kotlin/com/chmouel/liseur/reader/annotations/SelectionPopup.kt changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in SelectionPopupKt.ActionButtons at line 307. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/reader/annotations/SelectionPopup.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: app/src/main/kotlin/com/chmouel/liseur/tts/SpeechReadAloud.kt app/src/main/kotlin/com/chmouel/liseur/tts/SpeechReadAloud.kt:232β app/src/main/kotlin/com/chmouel/liseur/tts/SpeechReadAloud.kt changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in SpeechReadAloud.start at line 232. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/tts/SpeechReadAloud.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: app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.kt app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.kt:418β app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.kt changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in ReadingStatsScreenKt.PeriodBars at line 418. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.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: app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSnapshots.kt app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSnapshots.kt:93β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSnapshots.kt changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in LiseurSyncSnapshots.read at line 93. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSnapshots.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: app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.kt app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.kt:265β app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.kt changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in ServicesScreenKt.ServerScreen at line 265. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.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: app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.kt app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.kt:462β app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.kt changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in BrowseLibrariesScreenKt.BrowseConnectionScreen at line 462. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.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: app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteCatalogRepository.kt app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteCatalogRepository.kt:755β app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteCatalogRepository.kt changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in RemoteCatalogRepositoryKt.mergeCatalogEntry at line 755. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteCatalogRepository.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: app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslation.kt app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslation.kt:365β app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslation.kt changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in PageTranslation.walk at line 365. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslation.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: app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt:88β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in CompanionSheetKt.CharacterProfile at line 88. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.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: app/src/main/kotlin/com/chmouel/liseur/companion/CompanionLookups.kt app/src/main/kotlin/com/chmouel/liseur/companion/CompanionLookups.kt:271β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionLookups.kt changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in CompanionLookups.ask at line 271. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/companion/CompanionLookups.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: app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:681β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in BookOrbitPositionAgreementRepository.readBackLocked at line 681. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.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: app/src/main/kotlin/com/chmouel/liseur/tts/OpenAiSpeechService.kt app/src/main/kotlin/com/chmouel/liseur/tts/OpenAiSpeechService.kt:510β app/src/main/kotlin/com/chmouel/liseur/tts/OpenAiSpeechService.kt changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in OpenAiSpeechServiceKt.OpenAiRows at line 510. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/tts/OpenAiSpeechService.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: app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslationScreen.kt app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslationScreen.kt:99β app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslationScreen.kt changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in WholeBookTranslationScreenKt.WholeBookTranslationContent at line 99. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:03:15 +01:00' --until='2026-11-16 19:03:15 +01:00' --full-history --no-merges -- app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslationScreen.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.
+ 25 more in this group β see findings.md.
DM11 Β· Constructible invalid stateΒ· Constructible in an invalid state Β· Γ40
Constructible in an invalid state: CodexBookRow app/src/main/kotlin/com/chmouel/liseur/companion/CodexStore.kt:20β `CodexBookRow`'s public constructor takes `bookUrl`, `identity` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `CodexBookRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: CodexUnitRow app/src/main/kotlin/com/chmouel/liseur/companion/CodexStore.kt:27β `CodexUnitRow`'s public constructor takes `bookUrl`, `stats` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `CodexUnitRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: CodexPassageRow app/src/main/kotlin/com/chmouel/liseur/companion/CodexStore.kt:30β `CodexPassageRow`'s public constructor takes `bookUrl`, `ref`, `text`, `folded`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `CodexPassageRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: ChapterRecapRow app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:32β `ChapterRecapRow`'s public constructor takes `bookUrl`, `unitKey`, `contentSha`, `serverId`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `ChapterRecapRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: RecapPartRow app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:47β `RecapPartRow`'s public constructor takes `bookUrl`, `unitKey`, `contentSha`, `serverId`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `RecapPartRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: RecapQueueRow app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:62β `RecapQueueRow`'s public constructor takes `bookUrl`, `unitKey`, `contentSha` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `RecapQueueRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: StorySummaryRow app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:77β `StorySummaryRow`'s public constructor takes `bookUrl`, `key`, `contentSha`, `deps`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `StorySummaryRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: RecapChoiceRow app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:96β `RecapChoiceRow`'s public constructor takes `bookUrl` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `RecapChoiceRow` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: AnnotationSync app/src/main/kotlin/com/chmouel/liseur/data/db/AnnotationSync.kt:38β `AnnotationSync`'s public constructor takes `id`, `peerId`, `bookId`, `workId`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `AnnotationSync` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: Book app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:50β `Book`'s public constructor takes `url`, `title`, `author`, `coverPath`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `Book` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: LibraryFolder app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:1118β `LibraryFolder`'s public constructor takes `url` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `LibraryFolder` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookAiPreferences app/src/main/kotlin/com/chmouel/liseur/data/db/BookAiPreferences.kt:12β `BookAiPreferences`'s public constructor takes `bookUrl`, `translationDirection`, `narrationDirection` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookAiPreferences` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookAnnotation app/src/main/kotlin/com/chmouel/liseur/data/db/BookAnnotation.kt:31β `BookAnnotation`'s public constructor takes `id`, `bookId`, `kind`, `locatorJson`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookAnnotation` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookMetadata app/src/main/kotlin/com/chmouel/liseur/data/db/BookMetadata.kt:41β `BookMetadata`'s public constructor takes `bookUrl`, `source`, `subtitle`, `description`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookMetadata` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookOrbitBinding app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitBinding.kt:38β `BookOrbitBinding`'s public constructor takes `accountKey`, `bookUrl`, `fileFormat`, `fileName`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitBinding` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookOrbitCfiRecord app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitCfiRecord.kt:24β `BookOrbitCfiRecord`'s public constructor takes `accountKey`, `bookUrl`, `rawCfi` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitCfiRecord` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookOrbitLocalCfi app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitLocalCfi.kt:32β `BookOrbitLocalCfi`'s public constructor takes `accountKey`, `bookUrl`, `locatorJson`, `rawCfi` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitLocalCfi` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookOrbitPositionAgreement app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionAgreement.kt:25β `BookOrbitPositionAgreement`'s public constructor takes `accountKey`, `bookUrl`, `baseUrl`, `agreedLocatorJson`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitPositionAgreement` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookOrbitPositionTraversal app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionTraversal.kt:12β `BookOrbitPositionTraversal`'s public constructor takes `accountKey`, `baseUrl`, `afterUrl`, `failure` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitPositionTraversal` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookOrbitPositionTraversalItem app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionTraversal.kt:34β `BookOrbitPositionTraversalItem`'s public constructor takes `accountKey`, `bookUrl` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitPositionTraversalItem` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookOrbitStatusAgreement app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitStatusAgreement.kt:24β `BookOrbitStatusAgreement`'s public constructor takes `accountKey`, `bookUrl`, `baseUrl`, `agreedRemoteStatus`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookOrbitStatusAgreement` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookReadingMode app/src/main/kotlin/com/chmouel/liseur/data/db/BookReadingMode.kt:26β `BookReadingMode`'s public constructor takes `bookUrl` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookReadingMode` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookScreen app/src/main/kotlin/com/chmouel/liseur/data/db/BookScreen.kt:26β `BookScreen`'s public constructor takes `bookUrl` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookScreen` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: BookTypography app/src/main/kotlin/com/chmouel/liseur/data/db/BookTypography.kt:29β `BookTypography`'s public constructor takes `bookUrl`, `font`, `fontSize`, `lineHeight`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `BookTypography` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: FurthestPosition app/src/main/kotlin/com/chmouel/liseur/data/db/FurthestPosition.kt:14β `FurthestPosition`'s public constructor takes `peerId`, `workId`, `edition`, `origin`, β¦ as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `β¦Exception.ThrowIfβ¦(` helper, and so was any method of this type it calls β a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `FurthestPosition` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
+ 15 more in this group β see findings.md.
DM4 Β· Rich vs anemic modelΒ· Anemic entity Β· Γ40
Anemic entity: CodexBookRow app/src/main/kotlin/com/chmouel/liseur/companion/CodexStore.kt:20β `CodexBookRow` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: CodexUnitRow app/src/main/kotlin/com/chmouel/liseur/companion/CodexStore.kt:27β `CodexUnitRow` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: CodexPassageRow app/src/main/kotlin/com/chmouel/liseur/companion/CodexStore.kt:30β `CodexPassageRow` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: ChapterRecapRow app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:32β `ChapterRecapRow` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: RecapPartRow app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:47β `RecapPartRow` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: RecapQueueRow app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:62β `RecapQueueRow` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: StorySummaryRow app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:77β `StorySummaryRow` is an aggregate/entity with 13 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: RecapChoiceRow app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:96β `RecapChoiceRow` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: AnnotationSync app/src/main/kotlin/com/chmouel/liseur/data/db/AnnotationSync.kt:38β `AnnotationSync` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: Book app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:50β `Book` is an aggregate/entity with 52 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: LibraryFolder app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:1118β `LibraryFolder` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookAiPreferences app/src/main/kotlin/com/chmouel/liseur/data/db/BookAiPreferences.kt:12β `BookAiPreferences` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookAnnotation app/src/main/kotlin/com/chmouel/liseur/data/db/BookAnnotation.kt:31β `BookAnnotation` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookMetadata app/src/main/kotlin/com/chmouel/liseur/data/db/BookMetadata.kt:41β `BookMetadata` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookOrbitBinding app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitBinding.kt:38β `BookOrbitBinding` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookOrbitCfiRecord app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitCfiRecord.kt:24β `BookOrbitCfiRecord` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookOrbitLocalCfi app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitLocalCfi.kt:32β `BookOrbitLocalCfi` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookOrbitPositionAgreement app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionAgreement.kt:25β `BookOrbitPositionAgreement` is an aggregate/entity with 24 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookOrbitPositionTraversal app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionTraversal.kt:12β `BookOrbitPositionTraversal` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookOrbitPositionTraversalItem app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionTraversal.kt:34β `BookOrbitPositionTraversalItem` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookOrbitStatusAgreement app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitStatusAgreement.kt:24β `BookOrbitStatusAgreement` is an aggregate/entity with 18 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookReadingMode app/src/main/kotlin/com/chmouel/liseur/data/db/BookReadingMode.kt:26β `BookReadingMode` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookScreen app/src/main/kotlin/com/chmouel/liseur/data/db/BookScreen.kt:26β `BookScreen` is an aggregate/entity with 2 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: BookTypography app/src/main/kotlin/com/chmouel/liseur/data/db/BookTypography.kt:29β `BookTypography` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
Anemic entity: FurthestPosition app/src/main/kotlin/com/chmouel/liseur/data/db/FurthestPosition.kt:14β `FurthestPosition` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) β the business logic lives in a service.
FileTooLong: reader/ReaderScreen.kt app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.ktβ FileTooLong β 3456 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: class (439-5752). The bar is 500 significant lines; this is 2956 over it, 6.91× 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: library/LibraryScreen.kt app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.ktβ FileTooLong β 2098 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1598 over it, 4.20× 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: reader/ReaderViewModel.kt app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.ktβ FileTooLong β 1967 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: ReaderViewModel (157-3297). The bar is 500 significant lines; this is 1467 over it, 3.93× 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: liseursync/LiseurSyncPositionSync.kt app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.ktβ FileTooLong β 1637 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: LiseurSyncPositionSync (80-3071). The bar is 500 significant lines; this is 1137 over it, 3.27× 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: library/SettingsBackupRepository.kt app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.ktβ FileTooLong β 1432 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: SettingsBackupRepository (176-1822). The bar is 500 significant lines; this is 932 over it, 2.86× 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: db/LiseurDatabase.kt app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.ktβ FileTooLong β 1264 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: LiseurDatabase (51-2132). The bar is 500 significant lines; this is 764 over it, 2.53× 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: settings/ServerAccountScreen.kt app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.ktβ FileTooLong β 1234 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 734 over it, 2.47× 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: library/BrowseLibrariesScreen.kt app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.ktβ FileTooLong β 1146 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 646 over it, 2.29× 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: library/LibraryViewModel.kt app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryViewModel.ktβ FileTooLong β 1096 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: LibraryViewModel (512-1980). The bar is 500 significant lines; this is 596 over it, 2.19× 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: liseur/MainActivity.kt app/src/main/kotlin/com/chmouel/liseur/MainActivity.ktβ FileTooLong β 1022 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 522 over it, 2.04× 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: db/ReadingProgress.kt app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.ktβ FileTooLong β 866 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: ReadingProgressDao (205-1369). The bar is 500 significant lines; this is 366 over it, 1.73× 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: liseur/AppContainer.kt app/src/main/kotlin/com/chmouel/liseur/AppContainer.ktβ FileTooLong β 837 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: AppContainer (122-1224). The bar is 500 significant lines; this is 337 over it, 1.67× 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: tts/ReadAloudSettingsScreen.kt app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudSettingsScreen.ktβ FileTooLong β 829 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 329 over it, 1.66× 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: settings/AppSettings.kt app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.ktβ FileTooLong β 804 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: AppSettingsRepository (544-1447). The bar is 500 significant lines; this is 304 over it, 1.61× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body β the parts that share the same inputs and are named together β into its own unit in a sibling file, and have the original call them.
FileTooLong: library/LocalLibraryRepository.kt app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.ktβ FileTooLong β 782 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: LocalLibraryRepository (67-1620). The bar is 500 significant lines; this is 282 over it, 1.56× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body β the parts that share the same inputs and are named together β into its own unit in a sibling file, and have the original call them.
FileTooLong: translate/TranslationSettingsScreen.kt app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.ktβ FileTooLong β 778 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 278 over it, 1.56× 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: chrome/ReadingProgressUi.kt app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReadingProgressUi.ktβ FileTooLong β 767 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 267 over it, 1.53× 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: library/SeriesScreen.kt app/src/main/kotlin/com/chmouel/liseur/ui/library/SeriesScreen.ktβ FileTooLong β 751 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 251 over it, 1.50× 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: library/BookDetailsScreen.kt app/src/main/kotlin/com/chmouel/liseur/ui/library/BookDetailsScreen.ktβ FileTooLong β 745 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 245 over it, 1.49× 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: bookorbit/BookOrbitPositionAgreement.kt app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.ktβ FileTooLong β 733 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: BookOrbitPositionAgreementRepository (70-803). The bar is 500 significant lines; this is 233 over it, 1.47× 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: translate/SavedTranslations.kt app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.ktβ FileTooLong β 729 significant lines (blank, comment-only and punctuation-only lines excluded), about 64% of them inside a single declaration: SavedTranslations (481-1374). The bar is 500 significant lines; this is 229 over it, 1.46× 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: styles/HomeLibrary.kt app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/HomeLibrary.ktβ FileTooLong β 682 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 182 over it, 1.36× 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: reader/ReaderActivity.kt app/src/main/kotlin/com/chmouel/liseur/reader/ReaderActivity.ktβ FileTooLong β 660 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: ReaderActivity (82-1068). The bar is 500 significant lines; this is 160 over it, 1.32× 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: db/Book.kt app/src/main/kotlin/com/chmouel/liseur/data/db/Book.ktβ FileTooLong β 658 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: BookDao (279-1114). The bar is 500 significant lines; this is 158 over it, 1.32× 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: reading/ReadingAppearanceControls.kt app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.ktβ FileTooLong β 656 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 156 over it, 1.31× 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.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:320β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryViewModel.kt:1478β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/tts/KeyCommits.kt:46β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/tts/UtterancePrefetcher.kt:352β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/tts/UtterancePrefetcher.kt:362β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/tts/UtterancePrefetcher.kt:388β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/translate/DeviceTranslationService.kt:271β `catch (_: RuntimeException)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/translate/DeviceTranslationService.kt:293β `catch (_: RuntimeException)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/translate/SentenceRequest.kt:36β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationContext.kt:103β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationContext.kt:124β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:1007β `catch (e: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:1110β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:3186β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:3419β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:1393β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/SelectionBlock.kt:28β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/SelectionHandleFix.kt:299β `catch (refused: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/SpokenPassage.kt:29β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/SpokenPassage.kt:63β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/TranslatedPages.kt:92β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/TranslatedPages.kt:109β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/TranslatedPages.kt:292β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/progress/ScrollProgression.kt:35β `catch (_: Exception)` takes every exception and records none of it β the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/kotlin/com/chmouel/liseur/reader/footnotes/FootnoteLayout.kt:389β `catch (refused: 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.
ClassTooLong: ReaderViewModel app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:157β ClassTooLong β 1813 significant lines (blank, comment-only and punctuation-only lines excluded), 133 methods. The bar is 400 significant lines; this is 1413 over it, 4.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LiseurSyncPositionSync app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:80β ClassTooLong β 1569 significant lines (blank, comment-only and punctuation-only lines excluded), 75 methods. The bar is 400 significant lines; this is 1169 over it, 3.92× 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: SettingsBackupRepository app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:176β ClassTooLong β 1283 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 883 over it, 3.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LiseurDatabase app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:51β ClassTooLong β 1210 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 810 over it, 3.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LibraryViewModel app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryViewModel.kt:512β ClassTooLong β 792 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 392 over it, 1.98× 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: ReadingProgressDao app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt:205β ClassTooLong β 767 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 367 over it, 1.92× 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: AppContainer app/src/main/kotlin/com/chmouel/liseur/AppContainer.kt:122β ClassTooLong β 719 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 319 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LocalLibraryRepository app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:67β ClassTooLong β 702 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 302 over it, 1.76× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ReaderActivity app/src/main/kotlin/com/chmouel/liseur/reader/ReaderActivity.kt:82β ClassTooLong β 564 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 164 over it, 1.41× 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: LiseurSyncAnnotations app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:53β ClassTooLong β 560 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 160 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BookDao app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:279β ClassTooLong β 556 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods. The bar is 400 significant lines; this is 156 over it, 1.39× 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: BookOrbitPositionAgreementRepository app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:70β ClassTooLong β 540 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 140 over it, 1.35× 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: AppSettingsRepository app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:544β ClassTooLong β 521 significant lines (blank, comment-only and punctuation-only lines excluded), 80 methods. The bar is 400 significant lines; this is 121 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RemoteAccountRepository app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteAccountRepository.kt:42β ClassTooLong β 517 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 117 over it, 1.29× 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: KomgaSyncRepository app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:83β ClassTooLong β 472 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 72 over it, 1.18× 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: SavedTranslations app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.kt:481β ClassTooLong β 464 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 64 over it, 1.16× 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: ServerAccountViewModel app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountViewModel.kt:212β ClassTooLong β 418 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 18 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LiseurSyncSnapshots app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSnapshots.kt:52β ClassTooLong β 416 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 16 over it, 1.04× 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: SpeechReadAloud app/src/main/kotlin/com/chmouel/liseur/tts/SpeechReadAloud.kt:69β ClassTooLong β 405 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods. The bar is 400 significant lines; this is 5 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: ReadingStatsViewModel app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsViewModel.kt:155β ClassTooLong β 403 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 3 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.
TooManyMethods: ReaderViewModel app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:157β TooManyMethods β 133 methods. The bar is 30 methods; this is 103 over it, 4.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AppSettingsRepository app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:544β TooManyMethods β 80 methods. The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LiseurSyncPositionSync app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:80β TooManyMethods β 75 methods. The bar is 30 methods; this is 45 over it, 2.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LibraryViewModel app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryViewModel.kt:512β TooManyMethods β 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SavedTranslations app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.kt:481β TooManyMethods β 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ReadingProgressDao app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt:205β 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: LocalLibraryRepository app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:67β TooManyMethods β 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ServerAccountViewModel app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountViewModel.kt:212β TooManyMethods β 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SettingsBackupRepository app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:176β TooManyMethods β 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SpeechReadAloud app/src/main/kotlin/com/chmouel/liseur/tts/SpeechReadAloud.kt:69β 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: BookOrbitPositionAgreementRepository app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:70β 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: BrowseLibrariesViewModel app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesViewModel.kt:141β TooManyMethods β 36 methods. The bar is 30 methods; this is 6 over it, 1.20× 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: LiseurSyncApi app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncApi.kt:7β 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: OpenAiSpeechService app/src/main/kotlin/com/chmouel/liseur/tts/OpenAiSpeechService.kt:62β TooManyMethods β 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SyncPeerStateDao app/src/main/kotlin/com/chmouel/liseur/data/db/SyncPeerState.kt:101β 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: OpdsParser app/src/main/kotlin/com/chmouel/liseur/data/opds/OpdsParser.kt:127β 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: RemoteAccountRepository app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteAccountRepository.kt:42β TooManyMethods β 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ServiceTranslate app/src/main/kotlin/com/chmouel/liseur/translate/ServiceTranslate.kt:43β TooManyMethods β 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BookDownloadRepository app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloadRepository.kt:151β TooManyMethods β 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LiseurDatabase app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:51β TooManyMethods β 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
X2 Β· Cancellation propagationΒ· Suspend function with a blocking request Β· Γ15
Suspend function with a blocking request: send app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:183β `send` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: sendMaybeEmpty app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:199β `sendMaybeEmpty` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: upload app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncUploadClient.kt:90β `upload` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: download app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloader.kt:62β `download` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: delete app/src/main/kotlin/com/chmouel/liseur/data/calibre/CalibreDeleteClient.kt:22β `delete` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: readState app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboClient.kt:78β `readState` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: pushState app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboClient.kt:113β `pushState` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: exchange app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:75β `exchange` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: stream app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:106β `stream` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: mutate app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:140β `mutate` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: getObjectOrNull app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:191β `getObjectOrNull` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: postObject app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:204β `postObject` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: send app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:227β `send` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: get app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:246β `get` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: me app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitSetupClient.kt:195β `me` suspends, but makes its request with `newCall(β¦).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up β `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Duplicated block (7 lines × 2) app/src/main/kotlin/com/chmouel/liseur/companion/RecapScheduler.kt:452β app/src/main/kotlin/com/chmouel/liseur/companion/RecapScheduler.kt:452-458 | app/src/main/kotlin/com/chmouel/liseur/companion/StorySummaries.kt:365-372 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/companion/RecapScheduler.kt:452` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows β the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run β a one-line delegation has no helper inside it to lift β so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:252β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:252-258 | app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:363-369 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:252` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:177β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:177-183 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:183-189 β before extracting anything, compare `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:177` 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) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:251β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:251-257 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:269-275 β before extracting anything, compare `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:251` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/library/BookBackupRepository.kt:175β app/src/main/kotlin/com/chmouel/liseur/data/library/BookBackupRepository.kt:175-181 | app/src/main/kotlin/com/chmouel/liseur/data/library/BookBackupRepository.kt:281-287 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/library/BookBackupRepository.kt:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1004β app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1004-1010 | app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1311-1317 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1004` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/library/SvgCover.kt:116β app/src/main/kotlin/com/chmouel/liseur/data/library/SvgCover.kt:116-122 | app/src/main/kotlin/com/chmouel/liseur/data/library/SvgCover.kt:202-208 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/library/SvgCover.kt:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:767β app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:767-773 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsScreen.kt:466-472 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:767` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsZipBackupUi.kt:226β app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsZipBackupUi.kt:226-232 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsZipBackupUi.kt:382-388 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsZipBackupUi.kt:226` 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 after the matched lines, `app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsZipBackupUi.kt:233` calls `fill` and `app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsZipBackupUi.kt:389` does not β after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:109β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:109-115 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncTranslations.kt:94-100 β 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) app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:683β app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:683-689 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:2950-2956 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/calibre/CalibreUrl.kt:24β app/src/main/kotlin/com/chmouel/liseur/data/calibre/CalibreUrl.kt:24-30 | app/src/main/kotlin/com/chmouel/liseur/domain/DictionaryUrl.kt:34-40 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/calibre/CalibreUrl.kt:24` 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, `app/src/main/kotlin/com/chmouel/liseur/data/calibre/CalibreUrl.kt:23` calls `startsWith` and `app/src/main/kotlin/com/chmouel/liseur/domain/DictionaryUrl.kt:33` does not β after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt:451β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt:451-459 | app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSheet.kt:560-568 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt:451` it runs out through the closing brace of the declaration holding it β the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) app/src/main/kotlin/com/chmouel/liseur/companion/Investigation.kt:229β app/src/main/kotlin/com/chmouel/liseur/companion/Investigation.kt:229-237 | app/src/main/kotlin/com/chmouel/liseur/companion/Investigation.kt:259-267 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/companion/Investigation.kt:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:274β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:274-282 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:306-314 β before extracting anything, compare `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:274` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows β the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run β a one-line delegation has no helper inside it to lift β so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:1279β app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:1279-1287 | app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:1321-1329 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:1279` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt:64β app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt:64-72 | app/src/main/kotlin/com/chmouel/liseur/domain/TranslationBackup.kt:63-71 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt:64` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) app/src/main/kotlin/com/chmouel/liseur/reader/annotations/BookmarkRibbon.kt:89β app/src/main/kotlin/com/chmouel/liseur/reader/annotations/BookmarkRibbon.kt:89-97 | app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/ShelfDecor.kt:317-325 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReadingProgressUi.kt:224β app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReadingProgressUi.kt:224-232 | app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReadingProgressUi.kt:270-278 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReadingProgressUi.kt:224` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2475β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2475-2483 | app/src/main/kotlin/com/chmouel/liseur/ui/library/SeriesUi.kt:265-273 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2475` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2677β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2677-2685 | app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/StylePreview.kt:184-192 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:838β app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:838-846 | app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:864-872 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:838` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows β the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run β a one-line delegation has no helper inside it to lift β so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:170β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:170-175 | app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:554-558 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:170` 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) app/src/main/kotlin/com/chmouel/liseur/data/library/AnnotationBackupRepository.kt:101β app/src/main/kotlin/com/chmouel/liseur/data/library/AnnotationBackupRepository.kt:101-105 | app/src/main/kotlin/com/chmouel/liseur/data/library/ReadingSessionBackupRepository.kt:54-60 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/library/AnnotationBackupRepository.kt:101` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows β the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run β a one-line delegation has no helper inside it to lift β so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names β the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:1046β app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:1046-1051 | app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:1140-1144 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:1046` 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) app/src/main/kotlin/com/chmouel/liseur/domain/BookBackup.kt:24β app/src/main/kotlin/com/chmouel/liseur/domain/BookBackup.kt:24-28 | app/src/main/kotlin/com/chmouel/liseur/domain/ReadingPositionBackup.kt:29-33 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/domain/BookBackup.kt:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:4603β app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:4603-4607 | app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:5607-5611 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:4603` 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) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:323β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:323-327 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaHttp.kt:149-153 β 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. β These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaHttp.kt:139` calls `intOrNull`, `longOrNull`, `toLong` and `app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:320` does not β after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) app/src/main/kotlin/com/chmouel/liseur/reader/progress/BookOrbitViewportCfi.kt:134β app/src/main/kotlin/com/chmouel/liseur/reader/progress/BookOrbitViewportCfi.kt:134-138 | app/src/main/kotlin/com/chmouel/liseur/reader/progress/ExactLocatorAnchor.kt:255-259 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationHttp.kt:73β app/src/main/kotlin/com/chmouel/liseur/translate/TranslationHttp.kt:73-77 | app/src/main/kotlin/com/chmouel/liseur/tts/OpenAiTtsClient.kt:701-705 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCatalogClient.kt:64β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCatalogClient.kt:64-68 | app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCatalogClient.kt:126-130 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited.
D4 Β· Code DuplicationΒ· Edited copy of a member (10 corresponding lines) Β· Γ8
Edited copy of a member (10 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/library/SvgCover.kt:116β app/src/main/kotlin/com/chmouel/liseur/data/library/SvgCover.kt:116-127 | app/src/main/kotlin/com/chmouel/liseur/data/library/SvgCover.kt:202-211 β These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:418β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:418-427 | app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:442-452 β These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:187β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:187-197 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:203-212 β These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/progress/BookPositions.kt:262β app/src/main/kotlin/com/chmouel/liseur/reader/progress/BookPositions.kt:262-272 | app/src/main/kotlin/com/chmouel/liseur/reader/progress/BookPositions.kt:274-283 β These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:406β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:406-415 | app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:430-439 β These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/library/DocumentIdentity.kt:134β app/src/main/kotlin/com/chmouel/liseur/data/library/DocumentIdentity.kt:134-150 | app/src/main/kotlin/com/chmouel/liseur/data/library/DocumentIdentity.kt:152-161 β These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ContentsScreen.kt:550β app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ContentsScreen.kt:550-559 | app/src/main/kotlin/com/chmouel/liseur/reader/search/SearchScreen.kt:306-315 β These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/SelectionBlock.kt:23β app/src/main/kotlin/com/chmouel/liseur/reader/SelectionBlock.kt:23-32 | app/src/main/kotlin/com/chmouel/liseur/reader/progress/ScrollProgression.kt:30-39 β 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) app/src/foss/kotlin/com/chmouel/liseur/readaloud/ReadAloudFeatureFactory.kt:16β app/src/foss/kotlin/com/chmouel/liseur/readaloud/ReadAloudFeatureFactory.kt:16-26 | app/src/play/kotlin/com/chmouel/liseur/readaloud/ReadAloudFeatureFactory.kt:17-27 β before extracting anything, compare `app/src/foss/kotlin/com/chmouel/liseur/readaloud/ReadAloudFeatureFactory.kt` and `app/src/play/kotlin/com/chmouel/liseur/readaloud/ReadAloudFeatureFactory.kt` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it β treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/foss/kotlin/com/chmouel/liseur/readaloud/ReadAloudFeatureFactory.kt:16` 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, `app/src/play/kotlin/com/chmouel/liseur/readaloud/ReadAloudFeatureFactory.kt:28` calls `GeminiSpeechService` and `app/src/foss/kotlin/com/chmouel/liseur/readaloud/ReadAloudFeatureFactory.kt:27` 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 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitTime.kt:24β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitTime.kt:24-34 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaTime.kt:28-38 β 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 (11 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1383β app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1383-1393 | app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1418-1428 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1383` 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. β These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1382` calls `outputStream`, `buffered` and `app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1417` 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 (11 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:259β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:259-269 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:476-486 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:4889β app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:4889-4899 | app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:4901-4911 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2291β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2291-2301 | app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/StyleParts.kt:76-87 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2291` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names β the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. β These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/StyleParts.kt:75` calls `listOfNotNull`, `joinToString` and `app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2290` 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 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:780β app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:780-790 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:1310-1320 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:780` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. β These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:777` calls `Text` and `app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:1307` 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 (8 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1651β app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1651-1658 | app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1673-1680 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1651` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/AdvancedSheet.kt:131β app/src/main/kotlin/com/chmouel/liseur/reader/chrome/AdvancedSheet.kt:131-138 | app/src/main/kotlin/com/chmouel/liseur/reader/chrome/TypographySheet.kt:80-87 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/reader/chrome/AdvancedSheet.kt:131` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.kt:533β app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.kt:533-540 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:932-940 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.kt:533` 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 (8 lines × 2) app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslationSheet.kt:330β app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslationSheet.kt:330-337 | app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudVoiceSheet.kt:346-353 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslationSheet.kt:330` it runs out through the closing brace of the declaration holding it β the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:187β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:187-194 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:203-210 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:187` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. β These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:195` calls `parseOrNull`, `RemoteHttpFailure` and `app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:211` 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 (8 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:631β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:631-638 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:831-838 β before extracting anything, compare `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:674β app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:674-681 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:2941-2948 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. β These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:2938` calls `positionStatus`, `readingStatusFor` and `app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:672` does not β after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 Β· Code DuplicationΒ· Edited copy of a member (8 corresponding lines) Β· Γ6
Edited copy of a member (8 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt:367β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt:367-374 | app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt:405-413 β These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:108β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:108-115 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncTranslations.kt:93-100 β These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:1308β app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:1308-1316 | app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:1319-1326 β These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) app/src/play/kotlin/com/chmouel/liseur/translate/GeminiCacheDiagnostics.kt:71β app/src/play/kotlin/com/chmouel/liseur/translate/GeminiCacheDiagnostics.kt:71-79 | app/src/main/kotlin/com/chmouel/liseur/translate/ChatCacheDiagnostics.kt:27-34 β These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1731β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1731-1740 | app/src/play/kotlin/com/chmouel/liseur/translate/MlKitLanguagesPage.kt:185-192 β These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:468β app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:468-475 | app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:107-114 β These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (6 corresponding lines) Β· Γ6
Edited copy of a member (6 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/companion/CodexViewModel.kt:183β app/src/main/kotlin/com/chmouel/liseur/companion/CodexViewModel.kt:183-190 | app/src/main/kotlin/com/chmouel/liseur/companion/CodexViewModel.kt:193-198 β These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSnapshots.kt:329β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSnapshots.kt:329-334 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSnapshots.kt:337-343 β These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationClient.kt:171β app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationClient.kt:171-176 | app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationClient.kt:178-183 β These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/Endpaper.kt:522β app/src/main/kotlin/com/chmouel/liseur/reader/chrome/Endpaper.kt:522-527 | app/src/main/kotlin/com/chmouel/liseur/ui/library/SeriesScreen.kt:1092-1097 β These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:264β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:264-269 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaHttp.kt:85-90 β These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitSetupClient.kt:212β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitSetupClient.kt:212-217 | app/src/main/kotlin/com/chmouel/liseur/data/remote/SyncFailure.kt:195-201 β 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.
Duplicated block (12 lines × 2) app/src/main/kotlin/com/chmouel/liseur/companion/ServerCompanionService.kt:219β app/src/main/kotlin/com/chmouel/liseur/companion/ServerCompanionService.kt:219-230 | app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationService.kt:340-351 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/companion/ServerCompanionService.kt:219` 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) app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:195β app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:195-206 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:513-524 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:195` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:485β app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:485-496 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:1670-1681 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:485` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:1249β app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:1249-1260 | app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:1901-1912 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:1249` 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) app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslationSheet.kt:163β app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslationSheet.kt:163-174 | app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSheet.kt:188-199 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslationSheet.kt:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:907β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:907-918 | app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1083-1094 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:907` 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.
Change coupling: AppContainer.kt β RemoteServer.kt app/src/main/kotlin/com/chmouel/liseur/AppContainer.kt:1β `app/src/main/kotlin/com/chmouel/liseur/AppContainer.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteServer.kt` change together 73% of the time (8 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 8 shared commits counted here, the most recent 3 are `bdd23db6` feat: Enable automatic BookOrbit position sync; `7e6ca087` feat(sync): sync highlights, notes and bookmarks (#78); `e5ce4afb` feat(upload): background upload worker and Ask/Always/Never policy β run `git show` on any of them.
Change coupling: ReaderViewModel.kt β ReadingAppearanceControls.kt app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:1β `app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt` and `app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt` change together 62% of the time (8 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 8 shared commits counted here, the most recent 3 are `a41a2ef8` feat: Let the reader stay in portrait or landscape; `1b5ee856` feat: Change brightness by swiping the page edge; `d2e5b0ca` feat: let each footer corner show what you choose β run `git show` on any of them.
Change coupling: RemoteServer.kt β LiseurSyncServerSetup.kt app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteServer.kt:1β `app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteServer.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncServerSetup.kt` change together 60% of the time (6 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 6 shared commits counted here, the most recent 3 are `78e37501` fix: reconnecting to liseur-sync keeps the device and the account; `31fb23c1` feat: Implement cross-device reading statistics (ADR-0021); `852a9897` feat(server): the capability to delete a book on liseur-sync β run `git show` on any of them.
Change coupling: ReaderViewModel.kt β AdvancedSheet.kt app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:1β `app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt` and `app/src/main/kotlin/com/chmouel/liseur/reader/chrome/AdvancedSheet.kt` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well β a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency β the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE β the registration is the link, and it is meant not to be an import β and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `a41a2ef8` feat: Let the reader stay in portrait or landscape; `1b5ee856` feat: Change brightness by swiping the page edge; `d2e5b0ca` feat: let each footer corner show what you choose β run `git show` on any of them.
Change coupling: LiseurSyncServerSetup.kt β LibraryScreen.kt app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncServerSetup.kt:1β `app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncServerSetup.kt` and `app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt` 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) with no explicit dependency β the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE β the registration is the link, and it is meant not to be an import β and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `822e7543` feat: Let the reader choose between two BookOrbit places; `b43af50b` fix: ask to reach servers on the home network; `94644dcc` feat(liseursync): recover a sync whose work was deleted server-side β run `git show` on any of them.
D4 Β· Code DuplicationΒ· Edited copy of a member (4 corresponding lines) Β· Γ5
Edited copy of a member (4 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt:134β app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt:134-137 | app/src/main/kotlin/com/chmouel/liseur/domain/TranslationBackup.kt:139-142 β These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/translate/BookFacts.kt:72β app/src/main/kotlin/com/chmouel/liseur/translate/BookFacts.kt:72-75 | app/src/main/kotlin/com/chmouel/liseur/tts/ServerKeys.kt:70-73 β These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt:128β app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt:128-131 | app/src/main/kotlin/com/chmouel/liseur/domain/TranslationBackup.kt:133-136 β These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:294β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:294-297 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaHttp.kt:115-118 β These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt:139β app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt:139-142 | app/src/main/kotlin/com/chmouel/liseur/domain/TranslationBackup.kt:144-147 β 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 (15 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:218β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:218-232 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:235-249 β before extracting anything, compare `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:218` 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. β These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:250` calls `takeIf` and `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:233` 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 (15 lines × 2) app/src/main/kotlin/com/chmouel/liseur/reader/dictionary/DefinitionSheet.kt:391β app/src/main/kotlin/com/chmouel/liseur/reader/dictionary/DefinitionSheet.kt:391-405 | app/src/main/kotlin/com/chmouel/liseur/reader/dictionary/DefinitionSheet.kt:484-498 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/reader/dictionary/DefinitionSheet.kt:391` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/library/BookDetailsScreen.kt:135β app/src/main/kotlin/com/chmouel/liseur/ui/library/BookDetailsScreen.kt:135-149 | app/src/main/kotlin/com/chmouel/liseur/ui/stats/BookReadingStatsScreen.kt:74-88 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/library/BookDetailsScreen.kt:135` it runs out through the closing brace of the declaration holding it β the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1607β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1607-1621 | app/src/main/kotlin/com/chmouel/liseur/ui/library/SeriesPickerSheet.kt:242-256 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1607` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/stats/BookReadingStatsScreen.kt:239β app/src/main/kotlin/com/chmouel/liseur/ui/stats/BookReadingStatsScreen.kt:239-253 | app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.kt:623-637 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/stats/BookReadingStatsScreen.kt:239` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows β the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run β a one-line delegation has no helper inside it to lift β so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) app/src/main/kotlin/com/chmouel/liseur/providers/ServicePicker.kt:120β app/src/main/kotlin/com/chmouel/liseur/providers/ServicePicker.kt:120-125 | app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSheet.kt:659-664 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:304β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:304-309 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaHttp.kt:131-136 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:239β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncHttp.kt:239-244 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncUploadClient.kt:152-157 β 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) app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.kt:630β app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.kt:630-635 | app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationService.kt:388-393 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslations.kt:314β app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslations.kt:314-319 | app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslations.kt:372-377 β 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 first that the copies are not typed on the same thing: the declarations holding them bind `preview` to `WholeBookPreview` in one and `WholeBookPreview): Unit = container.translationAdmissions.bulk(preview.bookUrl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH β their common supertype where they have one, or a new abstraction over them where they do not β and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. β These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslations.kt:371` calls `check` and `app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslations.kt:313` does not β after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 Β· Code DuplicationΒ· Edited copy of a member (14 corresponding lines) Β· Γ4
Edited copy of a member (14 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/translate/OpenAiChatClient.kt:54β app/src/main/kotlin/com/chmouel/liseur/translate/OpenAiChatClient.kt:54-70 | app/src/main/kotlin/com/chmouel/liseur/translate/OpenAiChatClient.kt:97-110 β These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:1147β app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:1147-1160 | app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:1206-1220 β These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) app/src/foss/kotlin/com/chmouel/liseur/readaloud/ReadAloudFeatureFactory.kt:16β app/src/foss/kotlin/com/chmouel/liseur/readaloud/ReadAloudFeatureFactory.kt:16-29 | app/src/play/kotlin/com/chmouel/liseur/readaloud/ReadAloudFeatureFactory.kt:17-31 β These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitSetupClient.kt:102β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitSetupClient.kt:102-123 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSetupClient.kt:95-108 β These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (7 corresponding lines) Β· Γ4
Edited copy of a member (7 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitEpubInfoClient.kt:61β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitEpubInfoClient.kt:61-69 | app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitProgressClient.kt:88-94 β These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/ImageAtPoint.kt:280β app/src/main/kotlin/com/chmouel/liseur/reader/ImageAtPoint.kt:280-288 | app/src/main/kotlin/com/chmouel/liseur/reader/SpokenMarkTaps.kt:147-153 β These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/IssuedMoves.kt:237β app/src/main/kotlin/com/chmouel/liseur/reader/IssuedMoves.kt:237-248 | app/src/main/kotlin/com/chmouel/liseur/reader/progress/OpeningRestoration.kt:127-133 β These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:611β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:611-618 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:292-298 β These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (10 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:647β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:647-656 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:678-687 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:647` 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) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSheet.kt:530β app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSheet.kt:530-539 | app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSheet.kt:546-555 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2664β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2664-2678 | app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.kt:712-721 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2664` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:772β app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:772-781 | app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:788-797 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:772` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. β These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:801` calls `widthClass` and `app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:782` 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.
Change-coupling hub: MainActivity.kt β AdvancedSheet.kt, ReadingAppearanceScreen.kt, ReadingNavigationScreen.kt, SettingsScreen.kt app/src/main/kotlin/com/chmouel/liseur/MainActivity.ktβ `app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt` changes together with 4 other files β `app/src/main/kotlin/com/chmouel/liseur/reader/chrome/AdvancedSheet.kt`, `app/src/main/kotlin/com/chmouel/liseur/ui/settings/ReadingAppearanceScreen.kt`, `app/src/main/kotlin/com/chmouel/liseur/ui/settings/ReadingNavigationScreen.kt`, `app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsScreen.kt` β none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: ReaderActivity.kt β ReaderPreferencesRepository.kt, ReaderPreferencesMapper.kt, AdvancedSheet.kt, ReadingAppearanceControls.kt, ReadingAppearanceScreen.kt app/src/main/kotlin/com/chmouel/liseur/reader/ReaderActivity.ktβ `app/src/main/kotlin/com/chmouel/liseur/reader/ReaderActivity.kt` changes together with 5 other files β `app/src/main/kotlin/com/chmouel/liseur/data/settings/ReaderPreferencesRepository.kt`, `app/src/main/kotlin/com/chmouel/liseur/reader/ReaderPreferencesMapper.kt`, `app/src/main/kotlin/com/chmouel/liseur/reader/chrome/AdvancedSheet.kt`, `app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt`, `app/src/main/kotlin/com/chmouel/liseur/ui/settings/ReadingAppearanceScreen.kt` β none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
Change-coupling hub: LiseurSyncApi.kt β AppContainer.kt, LiseurDatabase.kt, RemoteAccountRepository.kt app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncApi.ktβ `app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncApi.kt` changes together with 3 other files β `app/src/main/kotlin/com/chmouel/liseur/AppContainer.kt`, `app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt`, `app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteAccountRepository.kt` β none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 Β· Code DuplicationΒ· Edited copy of a member (26 corresponding lines) Β· Γ3
Edited copy of a member (26 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/annotations/NoteEditor.kt:254β app/src/main/kotlin/com/chmouel/liseur/reader/annotations/NoteEditor.kt:254-290 | app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSheet.kt:481-506 β These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:181β app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:181-206 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:464-492 β These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.kt:850β app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.kt:850-883 | app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.kt:891-916 β These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (17 corresponding lines) Β· Γ3
Edited copy of a member (17 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncCatalogClient.kt:32β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncCatalogClient.kt:32-48 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncUploadClient.kt:59-88 β These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitUrl.kt:36β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitUrl.kt:36-53 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaUrl.kt:30-46 β These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/dictionary/WiktionaryClient.kt:338β app/src/main/kotlin/com/chmouel/liseur/reader/dictionary/WiktionaryClient.kt:338-354 | app/src/main/kotlin/com/chmouel/liseur/translate/TranslationHttp.kt:44-70 β 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) Β· Γ3
Edited copy of a member (11 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.kt:660β app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.kt:660-671 | app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.kt:695-705 β These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1445β app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1445-1455 | app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1457-1467 β These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/AppContainer.kt:240β app/src/main/kotlin/com/chmouel/liseur/AppContainer.kt:240-250 | app/src/main/kotlin/com/chmouel/liseur/ui/widget/WidgetUpdater.kt:99-110 β These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (9 corresponding lines) Β· Γ3
Edited copy of a member (9 corresponding lines) app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationClient.kt:282β app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationClient.kt:282-292 | app/src/play/kotlin/com/chmouel/liseur/tts/GeminiTtsClient.kt:217-225 β These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:110β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:110-119 | app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:194-202 β These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/SelectionHandleFix.kt:294β app/src/main/kotlin/com/chmouel/liseur/reader/SelectionHandleFix.kt:294-302 | app/src/main/kotlin/com/chmouel/liseur/reader/footnotes/SameDocumentLinks.kt:133-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.
D4 Β· Code DuplicationΒ· Edited copy of a member (5 corresponding lines) Β· Γ3
Edited copy of a member (5 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCfiRepository.kt:300β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCfiRepository.kt:300-304 | app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:780-784 β These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/DictionarySelection.kt:158β app/src/main/kotlin/com/chmouel/liseur/reader/DictionarySelection.kt:158-164 | app/src/main/kotlin/com/chmouel/liseur/reader/TranslatedPages.kt:361-365 β These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaFileSource.kt:22β app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaFileSource.kt:22-26 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncFileSource.kt:23-27 β These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Swallowed exception (empty catch) app/src/play/kotlin/com/chmouel/liseur/insights/FlavorUsageReporting.kt:146β 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) app/src/play/kotlin/com/chmouel/liseur/insights/FlavorUsageReporting.kt:152β 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) app/src/main/kotlin/com/chmouel/liseur/translate/DeviceTranslationService.kt:258β 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.
AC3 Β· Page structureΒ· Page without a main landmark Β· Γ2
Page without a main landmark promo/feature-graphic.html:3β No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark promo/thumbnail.html:3β No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D4 Β· Code DuplicationΒ· Edited copy of a member (32 corresponding lines) Β· Γ2
Edited copy of a member (32 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt:23β app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt:23-57 | app/src/main/kotlin/com/chmouel/liseur/domain/TranslationBackup.kt:18-49 β These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/translate/DeviceTranslationService.kt:142β app/src/main/kotlin/com/chmouel/liseur/translate/DeviceTranslationService.kt:142-175 | app/src/play/kotlin/com/chmouel/liseur/translate/MlKitTranslationService.kt:156-187 β These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copies of one member (3 members, 20+ corresponding lines) Β· Γ2
Edited copies of one member (3 members, 20+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/companion/RecapScheduler.kt:443β app/src/main/kotlin/com/chmouel/liseur/companion/RecapScheduler.kt:443-463 | app/src/main/kotlin/com/chmouel/liseur/companion/Reimmersion.kt:194-216 | app/src/main/kotlin/com/chmouel/liseur/companion/StorySummaries.kt:358-377 β These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 20+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt:611β app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt:611-632 | app/src/main/kotlin/com/chmouel/liseur/data/db/SyncPeerState.kt:199-224 | app/src/main/kotlin/com/chmouel/liseur/data/db/SyncPeerState.kt:498-517 β These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (12 corresponding lines) Β· Γ2
Edited copy of a member (12 corresponding lines) app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationClient.kt:295β app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationClient.kt:295-306 | app/src/play/kotlin/com/chmouel/liseur/tts/GeminiTtsClient.kt:228-241 β These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitAuth.kt:92β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitAuth.kt:92-111 | app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitSetupClient.kt:195-206 β These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (22 corresponding lines) Β· Γ2
Edited copy of a member (22 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationService.kt:149β app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationService.kt:149-170 | app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationService.kt:184-205 β 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.
Edited copy of a member (22 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/ui/UploadBookOfferDialog.kt:38β app/src/main/kotlin/com/chmouel/liseur/ui/UploadBookOfferDialog.kt:38-61 | app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1476-1497 β These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (16 corresponding lines) Β· Γ2
Edited copy of a member (16 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1648β app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1648-1663 | app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1669-1687 β These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/calibre/CalibreUrl.kt:18β app/src/main/kotlin/com/chmouel/liseur/data/calibre/CalibreUrl.kt:18-34 | app/src/main/kotlin/com/chmouel/liseur/domain/DictionaryUrl.kt:29-44 β These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (15 corresponding lines) Β· Γ2
Edited copy of a member (15 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSetupSheet.kt:197β app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSetupSheet.kt:197-213 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ReadingNavigationScreen.kt:625-639 β These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationService.kt:293β app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationService.kt:293-308 | app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationService.kt:158-172 β These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (13 corresponding lines) Β· Γ2
Edited copy of a member (13 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitUploadClient.kt:433β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitUploadClient.kt:433-445 | app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitUploadClient.kt:550-564 β These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) app/src/foss/kotlin/com/chmouel/liseur/translate/TranslateFeatureFactory.kt:12β app/src/foss/kotlin/com/chmouel/liseur/translate/TranslateFeatureFactory.kt:12-24 | app/src/play/kotlin/com/chmouel/liseur/translate/TranslateFeatureFactory.kt:12-27 β These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copies of one member (3 members, 9+ corresponding lines) Β· Γ2
Edited copies of one member (3 members, 9+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/TypographySheet.kt:124β app/src/main/kotlin/com/chmouel/liseur/reader/chrome/TypographySheet.kt:124-143 | app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1743-1763 | app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingSelectionActions.kt:58-66 β These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/companion/ServerCompanionService.kt:127β app/src/main/kotlin/com/chmouel/liseur/companion/ServerCompanionService.kt:127-135 | app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationService.kt:378-386 | app/src/main/kotlin/com/chmouel/liseur/tts/OpenAiSpeechService.kt:434-442 β These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 Β· Code DuplicationΒ· Edited copies of one member (3 members, 10+ corresponding lines) Β· Γ2
Edited copies of one member (3 members, 10+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/ClearTranslationsDialog.kt:12β app/src/main/kotlin/com/chmouel/liseur/reader/ClearTranslationsDialog.kt:12-24 | app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ExternalLinkDialog.kt:24-38 | app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:666-675 β These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:1118β app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:1118-1127 | app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:1135-1144 | app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:1190-1199 β These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (1 corresponding lines) Β· Γ2
Edited copy of a member (1 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:313β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitHttp.kt:313-313 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaHttp.kt:140-140 β These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncServerSetup.kt:198β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncServerSetup.kt:198-198 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/WorkResolver.kt:555-555 β These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (26 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:330β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:330-355 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:363-388 β before extracting anything, compare `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:330` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26 lines × 2) app/src/main/kotlin/com/chmouel/liseur/tts/OpenAiTtsClient.kt:508β app/src/main/kotlin/com/chmouel/liseur/tts/OpenAiTtsClient.kt:508-533 | app/src/play/kotlin/com/chmouel/liseur/tts/GeminiTtsClient.kt:85-110 β 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 (14 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/ShelvesLibrary.kt:515β app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/ShelvesLibrary.kt:515-528 | app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/StyleParts.kt:78-91 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/ShelvesLibrary.kt:515` 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 (14 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsBackupScreen.kt:238β app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsBackupScreen.kt:238-251 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsBackupScreen.kt:348-361 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsBackupScreen.kt:238` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. β These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsBackupScreen.kt:362` calls `Column`, `padding`, `Text` and `app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsBackupScreen.kt:252` 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 (13 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:204β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:204-216 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:221-233 β before extracting anything, compare `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:204` 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 (13 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingFineTypography.kt:207β app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingFineTypography.kt:207-219 | app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingFineTypography.kt:236-248 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingFineTypography.kt:207` 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 × 3) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationHttp.kt:31β app/src/main/kotlin/com/chmouel/liseur/translate/TranslationHttp.kt:31-38 | app/src/main/kotlin/com/chmouel/liseur/tts/OpenAiTtsClient.kt:761-768 | app/src/play/kotlin/com/chmouel/liseur/tts/GeminiTtsClient.kt:251-258 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made 3 times.
Duplicated block (8 lines × 3) app/src/main/kotlin/com/chmouel/liseur/data/settings/ServerSettings.kt:240β app/src/main/kotlin/com/chmouel/liseur/data/settings/ServerSettings.kt:240-247 | app/src/main/kotlin/com/chmouel/liseur/data/settings/ServerSettings.kt:262-269 | app/src/main/kotlin/com/chmouel/liseur/data/settings/ServerSettings.kt:323-330 β all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites β resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/settings/ServerSettings.kt:240` 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 × 3) app/src/main/kotlin/com/chmouel/liseur/data/library/AnnotationBackupRepository.kt:101β app/src/main/kotlin/com/chmouel/liseur/data/library/AnnotationBackupRepository.kt:101-105 | app/src/main/kotlin/com/chmouel/liseur/data/library/ReadingPositionBackupRepository.kt:40-44 | app/src/main/kotlin/com/chmouel/liseur/data/library/ReadingSessionBackupRepository.kt:54-60 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/library/AnnotationBackupRepository.kt:101` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows β the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run β a one-line delegation has no helper inside it to lift β so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names β the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:839β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:839-843 | app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:918-922 | app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:989-993 β all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites β resolving only two of them leaves the rest to drift apart the first time one is edited.
Low cohesion: MlKitTranslationTest (LCOM4 11) app/src/testPlay/kotlin/com/chmouel/liseur/translate/MlKitTranslationTest.kt:27β MlKitTranslationTest's methods fall into 11 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable β your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 11 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected β and which would otherwise dominate this list β are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: GeminiTranslationTest (LCOM4 4) app/src/testPlay/kotlin/com/chmouel/liseur/translate/GeminiTranslationTest.kt:15β GeminiTranslationTest's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable β your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected β and which would otherwise dominate this list β are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
AXR1 Β· Runtime accessibility (rendered)Β· WCAG 2.5.5 reproducibly failed on a screen of the running app Β· Γ1
WCAG 2.5.5 reproducibly failed on a screen of the running app β Accessibility-tree rule(s) android-target-size-enhanced failed on: /FrameLayout[0]/FrameLayout[0]/FrameLayout[0]/ViewGroup[0]/View[0]/View[0]/View[0]/View[1]/View[0]/View[0]. Read from the Android accessibility tree on an emulator (advisory β not scored); fix and re-scan to verify it clears.
AXR1 Β· Runtime accessibility (rendered)Β· WCAG 4.1.2 reproducibly failed on a screen of the running app Β· Γ1
WCAG 4.1.2 reproducibly failed on a screen of the running app β Accessibility-tree rule(s) android-accessible-name, android-editable-name failed on: /FrameLayout[0]/FrameLayout[0]/FrameLayout[0]/ViewGroup[0]/View[0]/View[0]/View[0]/View[1]/View[0]/View[0]. Read from the Android accessibility tree on an emulator (advisory β not scored); fix and re-scan to verify it clears.
ReaderScreenKt.ReaderScreen (cyclomatic 523) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:447β ReaderScreenKt.ReaderScreen has cyclomatic complexity 523 (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.
LibraryScreenKt.LibraryScreen (cyclomatic 95) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:204β LibraryScreenKt.LibraryScreen has cyclomatic complexity 95 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WholeBookTranslationScreenKt.WholeBookTranslationContent (cyclomatic 79) app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslationScreen.kt:99β WholeBookTranslationScreenKt.WholeBookTranslationContent has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SettingsBackupRepository.readArchive (cyclomatic 78) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1037β SettingsBackupRepository.readArchive has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SettingsBackupScreenKt.SettingsBackupScreen (cyclomatic 66) app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsBackupScreen.kt:69β SettingsBackupScreenKt.SettingsBackupScreen has cyclomatic complexity 66 (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.
MainActivityKt.LiseurApp (cyclomatic 64) app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt:300β MainActivityKt.LiseurApp has cyclomatic complexity 64 (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.
LiseurSyncSnapshots.read (cyclomatic 50) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSnapshots.kt:93β LiseurSyncSnapshots.read has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CodexSheetKt.CodexSheet (cyclomatic 44) app/src/main/kotlin/com/chmouel/liseur/companion/CodexSheet.kt:140β CodexSheetKt.CodexSheet has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReaderViewModel.open (cyclomatic 43) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:1408β ReaderViewModel.open has cyclomatic complexity 43 (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.
SettingsBackupRepository.restore (cyclomatic 40) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:746β SettingsBackupRepository.restore has cyclomatic complexity 40 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
BrowseLibrariesScreenKt.BrowseConnectionScreen (cyclomatic 39) app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.kt:462β BrowseLibrariesScreenKt.BrowseConnectionScreen has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ServerAccountScreenKt.ConnectedCard (cyclomatic 37) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:958β ServerAccountScreenKt.ConnectedCard has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ServicesScreenKt.ServerScreen (cyclomatic 36) app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.kt:265β ServicesScreenKt.ServerScreen has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ServerAccountScreenKt.ConnectForm (cyclomatic 36) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:607β ServerAccountScreenKt.ConnectForm has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReaderViewModel.onLocatorChanged (cyclomatic 34) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:1833β ReaderViewModel.onLocatorChanged has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ShelfDecorKt.rememberShelfArt (cyclomatic 34) app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/ShelfDecor.kt:115β ShelfDecorKt.rememberShelfArt has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LiseurSyncSnapshots.parsePage (cyclomatic 32) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSnapshots.kt:365β LiseurSyncSnapshots.parsePage has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SettingsBackupRepository.prepareExportLocked (cyclomatic 31) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:307β SettingsBackupRepository.prepareExportLocked has cyclomatic complexity 31 (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.
RemoteAccountRepository.storeLocked (cyclomatic 31) app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteAccountRepository.kt:656β RemoteAccountRepository.storeLocked has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ServerSettings.validateBackup (cyclomatic 30) app/src/main/kotlin/com/chmouel/liseur/data/settings/ServerSettings.kt:432β ServerSettings.validateBackup has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BookTranslationPreferencesEditorKt.BookTranslationPreferencesEditor (cyclomatic 29) app/src/main/kotlin/com/chmouel/liseur/translate/BookTranslationPreferencesEditor.kt:35β BookTranslationPreferencesEditorKt.BookTranslationPreferencesEditor has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BookDownloadWorker.download (cyclomatic 28) app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloadWorker.kt:30β BookDownloadWorker.download has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReaderActivity.onCreate (cyclomatic 28) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderActivity.kt:147β ReaderActivity.onCreate has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SelectionPopupKt.ActionButtons (cyclomatic 28) app/src/main/kotlin/com/chmouel/liseur/reader/annotations/SelectionPopup.kt:307β SelectionPopupKt.ActionButtons has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CompanionSheetKt.CharacterProfile (cyclomatic 27) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt:88β CompanionSheetKt.CharacterProfile has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BookDownloader.download (cyclomatic 27) app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloader.kt:62β BookDownloader.download has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReadingStateMergeKt.reconcileExactPosition (cyclomatic 27) app/src/main/kotlin/com/chmouel/liseur/domain/ReadingStateMerge.kt:357β ReadingStateMergeKt.reconcileExactPosition has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CompanionLookups.ask (cyclomatic 26) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionLookups.kt:271β CompanionLookups.ask 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.
BookOrbitPositionAgreementRepository.readBackLocked (cyclomatic 26) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:681β BookOrbitPositionAgreementRepository.readBackLocked has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LiseurSyncPositionSync.name (cyclomatic 25) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:1006β LiseurSyncPositionSync.name has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnnotationBackupKt.decodeAnnotationBackup (cyclomatic 25) app/src/main/kotlin/com/chmouel/liseur/domain/AnnotationBackup.kt:96β AnnotationBackupKt.decodeAnnotationBackup has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReadingStateMergeKt.reconcileReadingState (cyclomatic 25) app/src/main/kotlin/com/chmouel/liseur/domain/ReadingStateMerge.kt:244β ReadingStateMergeKt.reconcileReadingState has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OpenAiSpeechServiceKt.OpenAiRows (cyclomatic 25) app/src/main/kotlin/com/chmouel/liseur/tts/OpenAiSpeechService.kt:510β OpenAiSpeechServiceKt.OpenAiRows has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BookOrbitStatusSync.sync (cyclomatic 24) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitStatusSync.kt:25β BookOrbitStatusSync.sync 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.
AnnotationWire.record (cyclomatic 24) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/AnnotationWire.kt:230β AnnotationWire.record has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LiseurSyncPositionSync.uploadSessions (cyclomatic 24) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:2478β LiseurSyncPositionSync.uploadSessions 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.
DictionaryReferenceKt.dictionaryReference (cyclomatic 24) app/src/main/kotlin/com/chmouel/liseur/reader/dictionary/DictionaryReference.kt:7β DictionaryReferenceKt.dictionaryReference 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.
MainActivityKt.LibraryRoute (cyclomatic 23) app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt:966β MainActivityKt.LibraryRoute has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BookOrbitCfiDom.walk (cyclomatic 23) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCfiDom.kt:76β BookOrbitCfiDom.walk 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.
LiseurSyncPositionSync.run (cyclomatic 23) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:661β LiseurSyncPositionSync.run has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LiseurSyncSettings.sync (cyclomatic 23) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSettings.kt:69β LiseurSyncSettings.sync 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.
EndpaperKt.Endpaper (cyclomatic 23) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/Endpaper.kt:94β EndpaperKt.Endpaper has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BrowseLibrariesScreenKt.CatalogGrid (cyclomatic 23) app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.kt:963β BrowseLibrariesScreenKt.CatalogGrid has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Reimmersion.parse (cyclomatic 22) app/src/main/kotlin/com/chmouel/liseur/companion/Reimmersion.kt:136β Reimmersion.parse has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BookOrbitCfi.parsePath (cyclomatic 22) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCfi.kt:124β BookOrbitCfi.parsePath 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.
BookOrbitUploadClient.session (cyclomatic 22) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitUploadClient.kt:197β BookOrbitUploadClient.session 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.
KomgaSyncRepository.push (cyclomatic 22) app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:723β KomgaSyncRepository.push has cyclomatic complexity 22 (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.
ReadingSessionBackupRepository.restore (cyclomatic 22) app/src/main/kotlin/com/chmouel/liseur/data/library/ReadingSessionBackupRepository.kt:106β ReadingSessionBackupRepository.restore 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.
MemorableLines.score (cyclomatic 22) app/src/main/kotlin/com/chmouel/liseur/domain/quotes/MemorableLines.kt:85β MemorableLines.score has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReadAloudSettingsScreenKt.KeyRow (cyclomatic 22) app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudSettingsScreen.kt:954β ReadAloudSettingsScreenKt.KeyRow has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReadingSelectionActionsKt.SelectionActionEditor (cyclomatic 22) app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingSelectionActions.kt:387β ReadingSelectionActionsKt.SelectionActionEditor has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BookOrbitPositionAgreementRepository.adoptClosed (cyclomatic 21) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:387β BookOrbitPositionAgreementRepository.adoptClosed has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BookOrbitPositionSync.sync (cyclomatic 21) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionSync.kt:176β BookOrbitPositionSync.sync has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
TranslationBackupKt.book (cyclomatic 21) app/src/main/kotlin/com/chmouel/liseur/domain/TranslationBackup.kt:51β TranslationBackupKt.book has cyclomatic complexity 21 (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.
ReadingProgressUiKt.figureText (cyclomatic 21) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReadingProgressUi.kt:506β ReadingProgressUiKt.figureText has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StoryController.show (cyclomatic 20) app/src/main/kotlin/com/chmouel/liseur/companion/StoryController.kt:63β StoryController.show has cyclomatic complexity 20 (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.
BookOrbitPositionSync.syncPosition (cyclomatic 20) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionSync.kt:211β BookOrbitPositionSync.syncPosition has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
LiseurSyncPositionSync.push (cyclomatic 20) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:1898β LiseurSyncPositionSync.push 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.
LiseurSyncPositionSync.deliverPeak (cyclomatic 20) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:2090β LiseurSyncPositionSync.deliverPeak 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.
SeriesScreenKt.SeriesScreen (cyclomatic 20) app/src/main/kotlin/com/chmouel/liseur/ui/library/SeriesScreen.kt:114β SeriesScreenKt.SeriesScreen has cyclomatic complexity 20 (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.
ServerAccountScreenKt.ServerAccountScreen (cyclomatic 20) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:124β ServerAccountScreenKt.ServerAccountScreen has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ServerAccountScreenKt.messageRes (cyclomatic 21) 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.
BookExportRepository.exportTo (cyclomatic 19) app/src/main/kotlin/com/chmouel/liseur/data/library/BookExportRepository.kt:37β BookExportRepository.exportTo 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.
ReaderViewModel.maybeOfferBookOrbitCatchUp (cyclomatic 19) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:2178β ReaderViewModel.maybeOfferBookOrbitCatchUp has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Mp3Pcm.decode (cyclomatic 19) app/src/main/kotlin/com/chmouel/liseur/tts/Mp3Pcm.kt:57β Mp3Pcm.decode 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.
SpeechReadAloud.start (cyclomatic 19) app/src/main/kotlin/com/chmouel/liseur/tts/SpeechReadAloud.kt:232β SpeechReadAloud.start has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReadingSelectionActionsKt.ReadingSelectionActions (cyclomatic 19) app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingSelectionActions.kt:80β ReadingSelectionActionsKt.ReadingSelectionActions has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReadingStatsScreenKt.PeriodBars (cyclomatic 19) app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.kt:418β ReadingStatsScreenKt.PeriodBars has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LiseurSyncPositionSync.refresh (cyclomatic 18) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:137β LiseurSyncPositionSync.refresh 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.
LiseurSyncPositionSync.apply (cyclomatic 18) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:1462β LiseurSyncPositionSync.apply 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.
RemoteCatalogRepositoryKt.mergeCatalogEntry (cyclomatic 18) app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteCatalogRepository.kt:755β RemoteCatalogRepositoryKt.mergeCatalogEntry has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
BookSyncDialogKt.BookSyncDialog (cyclomatic 18) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/BookSyncDialog.kt:70β BookSyncDialogKt.BookSyncDialog 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.
PageTranslationSheetKt.PageTranslationSheet (cyclomatic 18) app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslationSheet.kt:83β PageTranslationSheetKt.PageTranslationSheet has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CodexExtractor.extract (cyclomatic 17) app/src/main/kotlin/com/chmouel/liseur/companion/CodexExtractor.kt:59β CodexExtractor.extract 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.
CodexViewModel.resume (cyclomatic 17) app/src/main/kotlin/com/chmouel/liseur/companion/CodexViewModel.kt:242β CodexViewModel.resume 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.
BookOrbitPositionSync.syncAll (cyclomatic 17) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionSync.kt:42β BookOrbitPositionSync.syncAll 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.
OpdsCatalogClient.browseSection (cyclomatic 17) app/src/main/kotlin/com/chmouel/liseur/data/opds/OpdsCatalogClient.kt:50β OpdsCatalogClient.browseSection has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ServerSettings.settleRestore (cyclomatic 17) app/src/main/kotlin/com/chmouel/liseur/data/settings/ServerSettings.kt:514β ServerSettings.settleRestore 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.
LibraryFilters.accepts (cyclomatic 17) app/src/main/kotlin/com/chmouel/liseur/domain/LibraryFilters.kt:165β LibraryFilters.accepts has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NoteMarkdown.render (cyclomatic 17) app/src/main/kotlin/com/chmouel/liseur/reader/annotations/NoteMarkdown.kt:253β NoteMarkdown.render has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ImageViewerKt.ImageViewer (cyclomatic 17) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ImageViewer.kt:132β ImageViewerKt.ImageViewer has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TranslationSheetKt.Translation (cyclomatic 17) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSheet.kt:275β TranslationSheetKt.Translation has cyclomatic complexity 17 (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.
MlKitLanguagesPageKt.LanguageRow (cyclomatic 17) app/src/play/kotlin/com/chmouel/liseur/translate/MlKitLanguagesPage.kt:195β MlKitLanguagesPageKt.LanguageRow has cyclomatic complexity 17 (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.
CodexSheetKt.highlightRanges (cyclomatic 16) app/src/main/kotlin/com/chmouel/liseur/companion/CodexSheet.kt:489β CodexSheetKt.highlightRanges has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
BookOrbitPositionExchange.run (cyclomatic 16) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionExchange.kt:38β BookOrbitPositionExchange.run has cyclomatic complexity 16 (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.
LiseurSyncPositionSync.recoverPush (cyclomatic 16) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:2273β LiseurSyncPositionSync.recoverPush 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.
BrowseCatalogRepository.listing (cyclomatic 16) app/src/main/kotlin/com/chmouel/liseur/data/remote/BrowseCatalogRepository.kt:269β BrowseCatalogRepository.listing 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.
UserFontRepository.importLocked (cyclomatic 16) app/src/main/kotlin/com/chmouel/liseur/data/settings/UserFontRepository.kt:146β UserFontRepository.importLocked 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.
PageTranslation.walk (cyclomatic 16) app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslation.kt:365β PageTranslation.walk 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.
TranslationSheetKt.TranslationSheet (cyclomatic 16) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSheet.kt:122β TranslationSheetKt.TranslationSheet 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.
ReadAloudVoiceSheetKt.Choice (cyclomatic 16) app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudVoiceSheet.kt:161β ReadAloudVoiceSheetKt.Choice 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.
BrowseLibrariesScreenKt.BrowseLibrariesRoute (cyclomatic 16) app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.kt:174β BrowseLibrariesScreenKt.BrowseLibrariesRoute 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.
SeriesPickerSheetKt.pickerSections (cyclomatic 16) app/src/main/kotlin/com/chmouel/liseur/ui/library/SeriesPickerSheet.kt:680β SeriesPickerSheetKt.pickerSections 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.
ServerAccountViewModel.credentialsSupplied (cyclomatic 16) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountViewModel.kt:886β ServerAccountViewModel.credentialsSupplied has cyclomatic complexity 16 (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.
ReaderScreenKt.ReaderScreen (cognitive 716) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:447β ReaderScreenKt.ReaderScreen has cognitive complexity 716 (threshold 15). Drivers by points: if/else 383 (505 pts), boolean chains 164, error handling 11 (19 pts), match/switch 11 (15 pts), loops 12 (13 pts) (nesting depth added 135). 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.
SettingsBackupRepository.readArchive (cognitive 130) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1037β SettingsBackupRepository.readArchive has cognitive complexity 130 (threshold 15). Drivers by points: if/else 45 (87 pts), boolean chains 20, error handling 12 (19 pts), loops 3 (4 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LibraryScreenKt.LibraryScreen (cognitive 118) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:204β LibraryScreenKt.LibraryScreen has cognitive complexity 118 (threshold 15). Drivers by points: if/else 58 (84 pts), match/switch 11 (17 pts), boolean chains 13, error handling 2 (4 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WholeBookTranslationScreenKt.WholeBookTranslationContent (cognitive 114) app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslationScreen.kt:99β WholeBookTranslationScreenKt.WholeBookTranslationContent has cognitive complexity 114 (threshold 15). Drivers by points: if/else 45 (77 pts), error handling 9 (17 pts), boolean chains 13, match/switch 4 (7 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsBackupScreenKt.SettingsBackupScreen (cognitive 109) app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsBackupScreen.kt:69β SettingsBackupScreenKt.SettingsBackupScreen has cognitive complexity 109 (threshold 15). Drivers by points: if/else 72 (94 pts), boolean chains 8, match/switch 4 (7 pts) (nesting depth added 25). 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.
CodexSheetKt.CodexSheet (cognitive 74) app/src/main/kotlin/com/chmouel/liseur/companion/CodexSheet.kt:140β CodexSheetKt.CodexSheet has cognitive complexity 74 (threshold 15). Drivers by points: if/else 34 (56 pts), boolean chains 15, match/switch 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiseurSyncSnapshots.read (cognitive 71) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSnapshots.kt:93β LiseurSyncSnapshots.read has cognitive complexity 71 (threshold 15). Drivers by points: if/else 33 (51 pts), boolean chains 15, loops 3 (4 pts), error handling 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderViewModel.open (cognitive 57) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:1408β ReaderViewModel.open has cognitive complexity 57 (threshold 15). Drivers by points: if/else 24 (30 pts), boolean chains 17, error handling 6 (10 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MainActivityKt.LiseurApp (cognitive 56) app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt:300β MainActivityKt.LiseurApp has cognitive complexity 56 (threshold 15). Drivers by points: if/else 32 (39 pts), boolean chains 12, match/switch 4 (5 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ServicesScreenKt.ServerScreen (cognitive 56) app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.kt:265β ServicesScreenKt.ServerScreen has cognitive complexity 56 (threshold 15). Drivers by points: if/else 33 (46 pts), boolean chains 7, match/switch 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderViewModel.onLocatorChanged (cognitive 52) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:1833β ReaderViewModel.onLocatorChanged has cognitive complexity 52 (threshold 15). Drivers by points: if/else 27 (43 pts), boolean chains 9 (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.
SettingsBackupRepository.restore (cognitive 46) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:746β SettingsBackupRepository.restore has cognitive complexity 46 (threshold 15). Drivers by points: error handling 28, if/else 16 (17 pts), match/switch 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiseurSyncPositionSync.name (cognitive 45) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:1006β LiseurSyncPositionSync.name has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (38 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerSettings.validateBackup (cognitive 43) app/src/main/kotlin/com/chmouel/liseur/data/settings/ServerSettings.kt:432β ServerSettings.validateBackup has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowseLibrariesScreenKt.BrowseConnectionScreen (cognitive 43) app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.kt:462β BrowseLibrariesScreenKt.BrowseConnectionScreen has cognitive complexity 43 (threshold 15). Drivers by points: if/else 29 (30 pts), match/switch 5 (8 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth β many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BookOrbitCfiDom.walk (cognitive 41) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCfiDom.kt:76β BookOrbitCfiDom.walk has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 6, loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotationBackupKt.decodeAnnotationBackup (cognitive 41) app/src/main/kotlin/com/chmouel/liseur/domain/AnnotationBackup.kt:96β AnnotationBackupKt.decodeAnnotationBackup has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 12, loops 2 (3 pts), error handling 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.
CodexExtractor.extract (cognitive 40) app/src/main/kotlin/com/chmouel/liseur/companion/CodexExtractor.kt:59β CodexExtractor.extract has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerAccountScreenKt.ConnectedCard (cognitive 40) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:958β ServerAccountScreenKt.ConnectedCard has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (29 pts), boolean chains 7, match/switch 3 (4 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ReadingSessionBackupRepository.restore (cognitive 39) app/src/main/kotlin/com/chmouel/liseur/data/library/ReadingSessionBackupRepository.kt:106β ReadingSessionBackupRepository.restore has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 5 (7 pts), boolean chains 4, match/switch 1 (4 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth β most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SettingsBackupRepository.prepareExportLocked (cognitive 39) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:307β SettingsBackupRepository.prepareExportLocked has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (20 pts), error handling 9 (11 pts), boolean chains 6, loops 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LiseurSyncPositionSync.push (cognitive 39) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:1898β LiseurSyncPositionSync.push has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 2 (6 pts), error handling 2 (4 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderActivity.onCreate (cognitive 38) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderActivity.kt:147β ReaderActivity.onCreate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShelfDecorKt.rememberShelfArt (cognitive 38) app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/ShelfDecor.kt:115β ShelfDecorKt.rememberShelfArt has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25 (34 pts), match/switch 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerAccountScreenKt.ConnectForm (cognitive 38) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:607β ServerAccountScreenKt.ConnectForm has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 10, match/switch 3 (4 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LiseurSyncSnapshots.parsePage (cognitive 37) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSnapshots.kt:365β LiseurSyncSnapshots.parsePage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 12, loops 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Reimmersion.parse (cognitive 36) app/src/main/kotlin/com/chmouel/liseur/companion/Reimmersion.kt:136β Reimmersion.parse has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 6, loops 3 (4 pts), match/switch 1 (3 pts), error handling 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.
LiseurSyncPositionSync.uploadSessions (cognitive 36) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:2478β LiseurSyncPositionSync.uploadSessions has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 3 (6 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookTranslationPreferencesEditorKt.BookTranslationPreferencesEditor (cognitive 36) app/src/main/kotlin/com/chmouel/liseur/translate/BookTranslationPreferencesEditor.kt:35β BookTranslationPreferencesEditorKt.BookTranslationPreferencesEditor has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18, error handling 7 (11 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth β many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Mp3Pcm.decode (cognitive 36) app/src/main/kotlin/com/chmouel/liseur/tts/Mp3Pcm.kt:57β Mp3Pcm.decode has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 4, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookOrbitPositionAgreementRepository.readBackLocked (cognitive 35) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:681β BookOrbitPositionAgreementRepository.readBackLocked has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23 (24 pts), boolean chains 7, error handling 2, match/switch 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.
LiseurSyncPositionSync.apply (cognitive 35) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:1462β LiseurSyncPositionSync.apply has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 6, loops 4 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookDownloader.download (cognitive 33) app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloader.kt:62β BookDownloader.download has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 3, error handling 2, loops 1, match/switch 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.
LiseurSyncPositionSync.run (cognitive 33) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:661β LiseurSyncPositionSync.run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (20 pts), match/switch 2 (5 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LiveSyncConnector.connected (cognitive 33) app/src/main/kotlin/com/chmouel/liseur/sync/LiveSyncConnector.kt:95β LiveSyncConnector.connected has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (16 pts), error handling 5 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookOrbitStatusSync.sync (cognitive 32) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitStatusSync.kt:25β BookOrbitStatusSync.sync has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 12 (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.
BookDownloadWorker.download (cognitive 32) app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloadWorker.kt:30β BookDownloadWorker.download has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 8, match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ServerSettings.settleRestore (cognitive 32) app/src/main/kotlin/com/chmouel/liseur/data/settings/ServerSettings.kt:514β ServerSettings.settleRestore has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (29 pts), error handling 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.
CompanionLookups.ask (cognitive 31) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionLookups.kt:271β CompanionLookups.ask has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (21 pts), error handling 4, match/switch 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookOrbitCfi.parsePath (cognitive 31) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCfi.kt:124β BookOrbitCfi.parsePath has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiseurSyncSettings.sync (cognitive 31) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncSettings.kt:69β LiseurSyncSettings.sync has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (24 pts), match/switch 1 (3 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadingSelectionActionsKt.ReadingSelectionActions (cognitive 31) app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingSelectionActions.kt:80β ReadingSelectionActionsKt.ReadingSelectionActions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 5 (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.
ReadingSelectionActionsKt.SelectionActionEditor (cognitive 31) app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingSelectionActions.kt:387β ReadingSelectionActionsKt.SelectionActionEditor has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22 (23 pts), boolean chains 8 (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.
RemoteAccountRepository.storeLocked (cognitive 30) app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteAccountRepository.kt:656β RemoteAccountRepository.storeLocked has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 14, if/else 12 (13 pts), match/switch 3 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ReadAloudSettingsScreenKt.KeyRow (cognitive 30) app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudSettingsScreen.kt:954β ReadAloudSettingsScreenKt.KeyRow has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BrowseLibrariesScreenKt.CatalogGrid (cognitive 30) app/src/main/kotlin/com/chmouel/liseur/ui/library/BrowseLibrariesScreen.kt:963β BrowseLibrariesScreenKt.CatalogGrid has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ReadingStateMergeKt.reconcileExactPosition (cognitive 29) app/src/main/kotlin/com/chmouel/liseur/domain/ReadingStateMerge.kt:357β ReadingStateMergeKt.reconcileExactPosition has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 16, if/else 12 (13 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PageCurl.mesh (cognitive 29) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/PageCurl.kt:81β PageCurl.mesh has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiseurSyncPositionSync.deliverPeak (cognitive 28) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:2090β LiseurSyncPositionSync.deliverPeak has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6, error handling 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowseCatalogRepository.listing (cognitive 28) app/src/main/kotlin/com/chmouel/liseur/data/remote/BrowseCatalogRepository.kt:269β BrowseCatalogRepository.listing has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadingStateMergeKt.reconcileReadingState (cognitive 28) app/src/main/kotlin/com/chmouel/liseur/domain/ReadingStateMerge.kt:244β ReadingStateMergeKt.reconcileReadingState has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 10, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
EndpaperKt.Endpaper (cognitive 28) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/Endpaper.kt:94β EndpaperKt.Endpaper has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 6 (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.
ReadingStatsScreenKt.PeriodBars (cognitive 28) app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.kt:418β ReadingStatsScreenKt.PeriodBars has cognitive complexity 28 (threshold 15). Drivers by points: if/else 24 (26 pts), match/switch 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.
BookExportRepository.exportTo (cognitive 27) app/src/main/kotlin/com/chmouel/liseur/data/library/BookExportRepository.kt:37β BookExportRepository.exportTo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 6 (8 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiseurSyncPositionSync.refresh (cognitive 27) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:137β LiseurSyncPositionSync.refresh has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PageTranslation.walk (cognitive 27) app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslation.kt:365β PageTranslation.walk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 2 (4 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerAccountScreenKt.ServerAccountScreen (cognitive 27) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:124β ServerAccountScreenKt.ServerAccountScreen has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, match/switch 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.
CodexSheetKt.codexLayout (cognitive 26) app/src/main/kotlin/com/chmouel/liseur/companion/CodexSheet.kt:748β CodexSheetKt.codexLayout has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 9 (13 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookOrbitUploadClient.session (cognitive 26) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitUploadClient.kt:197β BookOrbitUploadClient.session has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranslationBackupKt.book (cognitive 26) app/src/main/kotlin/com/chmouel/liseur/domain/TranslationBackup.kt:51β TranslationBackupKt.book has cognitive complexity 26 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 4 (7 pts), match/switch 2 (7 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.
DictionaryReferenceKt.dictionaryReference (cognitive 26) app/src/main/kotlin/com/chmouel/liseur/reader/dictionary/DictionaryReference.kt:7β DictionaryReferenceKt.dictionaryReference has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 8, match/switch 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAiSpeechServiceKt.OpenAiRows (cognitive 26) app/src/main/kotlin/com/chmouel/liseur/tts/OpenAiSpeechService.kt:510β OpenAiSpeechServiceKt.OpenAiRows has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 11, match/switch 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.
AnnotationWire.record (cognitive 25) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/AnnotationWire.kt:230β AnnotationWire.record has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 7 (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.
ReadingProgressUiKt.figureText (cognitive 25) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReadingProgressUi.kt:506β ReadingProgressUiKt.figureText has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction β a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full β so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WholeBookTranslation.scan (cognitive 25) app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslation.kt:43β WholeBookTranslation.scan has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WholeBookTranslation.retrying (cognitive 25) app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslation.kt:260β WholeBookTranslation.retrying has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (5 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeriesScreenKt.SeriesScreen (cognitive 25) app/src/main/kotlin/com/chmouel/liseur/ui/library/SeriesScreen.kt:114β SeriesScreenKt.SeriesScreen has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 2, match/switch 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.
MainActivityKt.LibraryRoute (cognitive 24) app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt:966β MainActivityKt.LibraryRoute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 6, match/switch 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.
CompanionSheetKt.CharacterProfile (cognitive 24) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt:88β CompanionSheetKt.CharacterProfile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 5, 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.
BookOrbitPositionSync.syncAll (cognitive 24) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionSync.kt:42β BookOrbitPositionSync.syncAll has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 6, 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.
LiseurSyncTranslations.pull (cognitive 24) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncTranslations.kt:186β LiseurSyncTranslations.pull has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 2 (4 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpdsCatalogClient.browseSection (cognitive 23) app/src/main/kotlin/com/chmouel/liseur/data/opds/OpdsCatalogClient.kt:50β OpdsCatalogClient.browseSection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, error handling 3 (6 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteCatalogRepositoryKt.mergeCatalogEntry (cognitive 23) app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteCatalogRepository.kt:755β RemoteCatalogRepositoryKt.mergeCatalogEntry has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, boolean chains 5, match/switch 5. 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.
BookSyncDialogKt.BookSyncDialog (cognitive 23) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/BookSyncDialog.kt:70β BookSyncDialogKt.BookSyncDialog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 3 (6 pts) (nesting depth added 10). The drivers above price the dispatch low by construction β a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full β so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ImageViewerKt.ImageViewer (cognitive 23) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ImageViewer.kt:132β ImageViewerKt.ImageViewer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 3, loops 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.
AudioTrackPcmOutput.play (cognitive 23) app/src/main/kotlin/com/chmouel/liseur/tts/PcmOutput.kt:103β AudioTrackPcmOutput.play has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KomgaSyncRepository.push (cognitive 22) app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:723β KomgaSyncRepository.push has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (7 pts), boolean chains 5, 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.
ReadingSessionBackupRepository.writeContents (cognitive 22) app/src/main/kotlin/com/chmouel/liseur/data/library/ReadingSessionBackupRepository.kt:39β ReadingSessionBackupRepository.writeContents has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LibraryShelfKt.entryComparator (cognitive 22) app/src/main/kotlin/com/chmouel/liseur/domain/LibraryShelf.kt:100β LibraryShelfKt.entryComparator has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 1 (nesting depth added 7). 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.
LibrarySortKt.arrangedBy (cognitive 22) app/src/main/kotlin/com/chmouel/liseur/domain/LibrarySort.kt:112β LibrarySortKt.arrangedBy has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 1 (nesting depth added 7). 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.
PageTranslationSheetKt.PageTranslationSheet (cognitive 22) app/src/main/kotlin/com/chmouel/liseur/translate/PageTranslationSheet.kt:83β PageTranslationSheetKt.PageTranslationSheet has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WholeBookTranslation.run (cognitive 22) app/src/main/kotlin/com/chmouel/liseur/translate/WholeBookTranslation.kt:109β WholeBookTranslation.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SpeechCache.synthesizeWithRetry (cognitive 22) app/src/main/kotlin/com/chmouel/liseur/tts/UtterancePrefetcher.kt:207β SpeechCache.synthesizeWithRetry has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StoryController.show (cognitive 21) app/src/main/kotlin/com/chmouel/liseur/companion/StoryController.kt:63β StoryController.show has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, boolean chains 8, error handling 2. 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.
BookOrbitCatalogClient.cardFor (cognitive 21) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCatalogClient.kt:163β BookOrbitCatalogClient.cardFor has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, 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.
OpdsParser.blockText (cognitive 21) app/src/main/kotlin/com/chmouel/liseur/data/opds/OpdsParser.kt:698β OpdsParser.blockText has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SelectionPopupKt.ActionButtons (cognitive 21) app/src/main/kotlin/com/chmouel/liseur/reader/annotations/SelectionPopup.kt:307β SelectionPopupKt.ActionButtons has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, match/switch 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.
ContentsScreenKt.AnnotationRow (cognitive 21) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ContentsScreen.kt:418β ContentsScreenKt.AnnotationRow has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19 (20 pts), match/switch 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.
ReadAloudSettingsScreenKt.VoicePicker (cognitive 21) app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudSettingsScreen.kt:669β ReadAloudSettingsScreenKt.VoicePicker has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SpeechReadAloud.start (cognitive 21) app/src/main/kotlin/com/chmouel/liseur/tts/SpeechReadAloud.kt:232β SpeechReadAloud.start has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3, error handling 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SeriesPickerSheetKt.pickerSections (cognitive 21) app/src/main/kotlin/com/chmouel/liseur/ui/library/SeriesPickerSheet.kt:680β SeriesPickerSheetKt.pickerSections has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2 (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.
ShelvesLibraryKt.PlankBoardRow (cognitive 21) app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/ShelvesLibrary.kt:293β ShelvesLibraryKt.PlankBoardRow has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 3 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CodexViewModel.resume (cognitive 20) app/src/main/kotlin/com/chmouel/liseur/companion/CodexViewModel.kt:242β CodexViewModel.resume has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, error handling 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.
CodexViewModel.loadMore (cognitive 20) app/src/main/kotlin/com/chmouel/liseur/companion/CodexViewModel.kt:409β CodexViewModel.loadMore has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, error handling 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StoryTabKt.SoFarSection (cognitive 20) app/src/main/kotlin/com/chmouel/liseur/companion/StoryTab.kt:219β StoryTabKt.SoFarSection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, 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.
BookOrbitPositionAgreementRepository.adoptClosed (cognitive 20) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt:387β BookOrbitPositionAgreementRepository.adoptClosed has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 16, if/else 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BookOrbitPositionSync.sync (cognitive 20) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionSync.kt:176β BookOrbitPositionSync.sync has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 8, match/switch 2 (3 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
KosyncPositionSync.act (cognitive 20) app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:476β KosyncPositionSync.act has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 2 (3 pts) (nesting depth added 9). 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.
LibraryFilters.accepts (cognitive 20) app/src/main/kotlin/com/chmouel/liseur/domain/LibraryFilters.kt:165β LibraryFilters.accepts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, match/switch 1 (2 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.
MemorableLines.score (cognitive 20) app/src/main/kotlin/com/chmouel/liseur/domain/quotes/MemorableLines.kt:85β MemorableLines.score has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 5, 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.
TranslationSettingsScreenKt.SavedTranslationsGroup (cognitive 20) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:894β TranslationSettingsScreenKt.SavedTranslationsGroup has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ServerAccountScreenKt.KosyncSection (cognitive 20) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:1270β ServerAccountScreenKt.KosyncSection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CodexSheetKt.highlightRanges (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/companion/CodexSheet.kt:489β CodexSheetKt.highlightRanges has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexSheetKt.CodexMap (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/companion/CodexSheet.kt:590β CodexSheetKt.CodexMap has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4, match/switch 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.
CompanionStore.trim (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:515β CompanionStore.trim has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (6 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.
StoryTabKt.StoryRow (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/companion/StoryTab.kt:412β StoryTabKt.StoryRow has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BookOrbitCfiDom.encodePath (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCfiDom.kt:132β BookOrbitCfiDom.encodePath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsBackupRepository.writePreparedExportLocked (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:541β SettingsBackupRepository.writePreparedExportLocked has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 pts), error handling 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsBackupRepository.inspect (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:658β SettingsBackupRepository.inspect has cognitive complexity 19 (threshold 15). Drivers by points: error handling 5 (10 pts), if/else 3 (5 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction β a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full β so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AppSettingsRepository.restoreBackupValues (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/data/settings/AppSettings.kt:783β AppSettingsRepository.restoreBackupValues has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LibraryLayoutKt.planksOf (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/domain/LibraryLayout.kt:259β LibraryLayoutKt.planksOf has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderViewModel.maybeOfferBookOrbitCatchUp (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:2178β ReaderViewModel.maybeOfferBookOrbitCatchUp has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 5, error handling 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.
NoteEditorKt.NoteEditor (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/reader/annotations/NoteEditor.kt:98β NoteEditorKt.NoteEditor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3 (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.
ReadAloudPlayerKt.ReadAloudPlayer (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudPlayer.kt:87β ReadAloudPlayerKt.ReadAloudPlayer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth β many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReadingSelectionActionsKt.ActionRow (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingSelectionActions.kt:331β ReadingSelectionActionsKt.ActionRow has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3 (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.
ServerAccountScreenKt.BulkDownloadStatus (cognitive 19) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:472β ServerAccountScreenKt.BulkDownloadStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, match/switch 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.
BookOrbitPositionSync.syncPosition (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionSync.kt:211β BookOrbitPositionSync.syncPosition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalLibraryRepository.shelve (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:771β LocalLibraryRepository.shelve has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalLibraryRepository.findEpubs (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:943β LocalLibraryRepository.findEpubs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiseurSyncPositionSync.seedAll (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:1223β LiseurSyncPositionSync.seedAll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiseurSyncPositionSync.recoverPush (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:2273β LiseurSyncPositionSync.recoverPush has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, match/switch 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.
WorkResolver.prefetchCatalog (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/WorkResolver.kt:335β WorkResolver.prefetchCatalog has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), loops 2 (3 pts), match/switch 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.
OpdsCatalogClient.allBooks (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/data/opds/OpdsCatalogClient.kt:141β OpdsCatalogClient.allBooks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuoteScanner.walk (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/data/quotes/HomeQuotes.kt:512β QuoteScanner.walk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowseCatalogRepository.categoryBooks (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/data/remote/BrowseCatalogRepository.kt:342β BrowseCatalogRepository.categoryBooks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranslatedPages.follow (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/reader/TranslatedPages.kt:156β TranslatedPages.follow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NoteMarkdown.inline (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/reader/annotations/NoteMarkdown.kt:124β NoteMarkdown.inline has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WiktionaryHtmlKt.definitionItemsOf (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/reader/dictionary/WiktionaryHtml.kt:135β WiktionaryHtmlKt.definitionItemsOf has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 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.
SpeechCache.request (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/tts/UtterancePrefetcher.kt:162β SpeechCache.request has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomeLibraryKt.HomeLibrary (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/HomeLibrary.kt:109β HomeLibraryKt.HomeLibrary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HomeLibraryKt.HeroCard (cognitive 18) app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/HomeLibrary.kt:459β HomeLibraryKt.HeroCard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 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.
CompanionSheetKt.AliasPills (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt:304β CompanionSheetKt.AliasPills has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Session.around (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/companion/Investigation.kt:279β Session.around has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (8 pts), loops 1 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PublicationCodexSource.scan (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/companion/PublicationCodexSource.kt:19β PublicationCodexSource.scan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 5 (6 pts), match/switch 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.
LocalLibraryRepository.reindexBook (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:1022β LocalLibraryRepository.reindexBook has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 5. 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.
SettingsBackupRepository.readStagedArchive (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:988β SettingsBackupRepository.readStagedArchive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiseurSyncAnnotations.reconcile (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:373β LiseurSyncAnnotations.reconcile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiseurSyncAnnotations.push (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:542β LiseurSyncAnnotations.push has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 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.
LiseurSyncTranslations.sync (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncTranslations.kt:124β LiseurSyncTranslations.sync has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadingPositionBackupKt.decodeReadingPositionBackup (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/domain/ReadingPositionBackup.kt:25β ReadingPositionBackupKt.decodeReadingPositionBackup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth β many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReaderCompanionHostKt.CompanionPanelHost (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderCompanionHost.kt:36β ReaderCompanionHostKt.CompanionPanelHost has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ReaderTapZones.actionAt (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReaderTapZones.kt:193β ReaderTapZones.actionAt 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.
ReadingProgressUiKt.ReadingFooter (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReadingProgressUi.kt:129β ReadingProgressUiKt.ReadingFooter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth β many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LatestPositionSync.drain (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/sync/ReadingPositionPublisher.kt:320β LatestPositionSync.drain has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranslationSettingsScreenKt.TranslationSettingsScreen (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:141β TranslationSettingsScreenKt.TranslationSettingsScreen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TranslationSettingsScreenKt.TestRow (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:829β TranslationSettingsScreenKt.TestRow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 3, error handling 1, 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.
TranslationSheetKt.TranslationSheet (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSheet.kt:122β TranslationSheetKt.TranslationSheet has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, error handling 1, match/switch 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.
ReadAloudVoiceSheetKt.Choice (cognitive 17) app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudVoiceSheet.kt:161β ReadAloudVoiceSheetKt.Choice has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
feature-graphic.html.problems (cognitive 17) promo/feature-graphic.html:90β feature-graphic.html.problems has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 3 (nesting depth added 5). Of this number, 15 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.run (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/companion/Investigation.kt:177β Session.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 3, error handling 1 (2 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookOrbitCfi.parse (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCfi.kt:87β BookOrbitCfi.parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KosyncPositionSync.run (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:325β KosyncPositionSync.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookBackupRepository.prepareContents (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/data/library/BookBackupRepository.kt:75β BookBackupRepository.prepareContents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiseurSyncPositionSync.previewBook (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:211β LiseurSyncPositionSync.previewBook has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth β checks laid out side by side rather than stacked β so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
LiseurSyncTranslations.post (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncTranslations.kt:325β LiseurSyncTranslations.post has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiseurSyncTranslations.drainClears (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncTranslations.kt:400β LiseurSyncTranslations.drainClears has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), error handling 2 (4 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteCatalogRepository.retryPendingSeriesClaims (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteCatalogRepository.kt:349β RemoteCatalogRepository.retryPendingSeriesClaims has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, error handling 2, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeriesShelfKt.arrangedBy (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/domain/SeriesShelf.kt:298β SeriesShelfKt.arrangedBy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (nesting depth added 5). 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.
ReaderViewModel.applyBookOrbitChoice (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderViewModel.kt:930β ReaderViewModel.applyBookOrbitChoice has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, error handling 3 (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.
DefinitionSheetKt.DefinitionSheet (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/reader/dictionary/DefinitionSheet.kt:77β DefinitionSheetKt.DefinitionSheet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 4, 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.
SentenceTranslations.resolve (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/translate/SentenceTranslations.kt:131β SentenceTranslations.resolve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 3 (7 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpeechTtsEngine.awaitCurrentAudio (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/tts/SpeechTtsEngine.kt:283β SpeechTtsEngine.awaitCurrentAudio has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookDetailsScreenKt.BookActions (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/ui/library/BookDetailsScreen.kt:293β BookDetailsScreenKt.BookActions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LibraryScreenKt.BookCard (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2270β LibraryScreenKt.BookCard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 4, 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.
SeriesPickerSheetKt.SeriesOptionRow (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/ui/library/SeriesPickerSheet.kt:411β SeriesPickerSheetKt.SeriesOptionRow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 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.
MainTabBarKt.icon (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/ui/navigation/MainTabBar.kt:222β MainTabBarKt.icon has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (nesting depth added 5). 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.
ReadingStatsScreenKt.ComparisonLine (cognitive 16) app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.kt:784β ReadingStatsScreenKt.ComparisonLine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 3 (nesting depth added 4). 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.
Near-duplicate member pair (64 shared lines) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:268β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:268-355 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:300-388 β These two members are variants of one another: 64 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain β factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 Β· Code DuplicationΒ· Members sharing a duplicated core (6 members, 50+ identical tokens) Β· Γ1
Members sharing a duplicated core (6 members, 50+ identical tokens) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSettingsScreen.kt:83β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSettingsScreen.kt:83-229 | app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:141-286 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/HiddenBooksScreen.kt:48-98 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ReadingAppearanceScreen.kt:103-234 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsScreen.kt:122-444 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/WatchedFoldersScreen.kt:59-174 β These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below β it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain β factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 Β· Code DuplicationΒ· Members sharing a duplicated core (4 members, 50+ identical tokens) Β· Γ1
Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.kt:221β app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.kt:221-251 | app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudSettingsScreen.kt:165-248 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ReadingNavigationScreen.kt:125-348 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:160-341 β These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below β it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain β factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 Β· Code DuplicationΒ· Edited copy of a member (75 corresponding lines) Β· Γ1
Edited copy of a member (75 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2288β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2288-2380 | app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/StyleParts.kt:72-146 β These two members are one piece of code written twice and then edited apart: 75 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (38 corresponding lines) Β· Γ1
Edited copy of a member (38 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/companion/ServerCompanionService.kt:176β app/src/main/kotlin/com/chmouel/liseur/companion/ServerCompanionService.kt:176-231 | app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationService.kt:314-351 β These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (68 corresponding lines) Β· Γ1
Edited copy of a member (68 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:523β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:523-590 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:641-712 β These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:188β app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:188-236 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:506-564 β 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 (37 corresponding lines) Β· Γ1
Edited copy of a member (37 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:203β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:203-239 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:220-257 β These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (35 corresponding lines) Β· Γ1
Edited copy of a member (35 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:118β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:118-153 | app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:126-160 β These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (41 corresponding lines) Β· Γ1
Edited copy of a member (41 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:567β app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:567-608 | app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingFineTypography.kt:264-304 β These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (34 corresponding lines) Β· Γ1
Edited copy of a member (34 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2662β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2662-2699 | app/src/main/kotlin/com/chmouel/liseur/ui/stats/ReadingStatsScreen.kt:709-742 β 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 (29 corresponding lines) Β· Γ1
Edited copy of a member (29 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:203β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:203-231 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:1396-1431 β These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (23 corresponding lines) Β· Γ1
Edited copy of a member (23 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:1275β app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:1275-1304 | app/src/main/kotlin/com/chmouel/liseur/data/library/LocalLibraryRepository.kt:1317-1339 β 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 (19 corresponding lines) Β· Γ1
Edited copy of a member (19 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:248β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:248-266 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:266-285 β These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (21 corresponding lines) Β· Γ1
Edited copy of a member (21 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingFineTypography.kt:199β app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingFineTypography.kt:199-219 | app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingFineTypography.kt:228-248 β These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copies of one member (3 members, 15+ corresponding lines) Β· Γ1
Edited copies of one member (3 members, 15+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:833β app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:833-852 | app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:859-878 | app/src/main/kotlin/com/chmouel/liseur/ui/reading/ReadingAppearanceControls.kt:909-923 β These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 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, 12+ corresponding lines) Β· Γ1
Edited copies of one member (3 members, 12+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1368β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1368-1379 | app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1430-1441 | app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1450-1461 β These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 Β· Code DuplicationΒ· Edited copy of a member (20 corresponding lines) Β· Γ1
Edited copy of a member (20 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/AdvancedSheet.kt:209β app/src/main/kotlin/com/chmouel/liseur/reader/chrome/AdvancedSheet.kt:209-228 | app/src/main/kotlin/com/chmouel/liseur/reader/chrome/AdvancedSheet.kt:235-254 β 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 copies of one member (4 members, 18+ corresponding lines) Β· Γ1
Edited copies of one member (4 members, 18+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2474β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2474-2491 | app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2753-2770 | app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2780-2797 | app/src/main/kotlin/com/chmouel/liseur/ui/library/SeriesUi.kt:264-281 β These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 Β· Code DuplicationΒ· Edited copies of one member (3 members, 14+ corresponding lines) Β· Γ1
Edited copies of one member (3 members, 14+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryEmptyStates.kt:367β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryEmptyStates.kt:367-382 | app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryEmptyStates.kt:395-408 | app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryEmptyStates.kt:421-434 β 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 copy of a member (3 corresponding lines) Β· Γ1
Edited copy of a member (3 corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncCatalogClient.kt:154β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncCatalogClient.kt:154-156 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:2888-2890 β These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below β the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain β factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 Β· Code DuplicationΒ· Edited copies of one member (3 members, 3+ corresponding lines) Β· Γ1
Edited copies of one member (3 members, 3+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationService.kt:92β app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationService.kt:92-94 | app/src/main/kotlin/com/chmouel/liseur/translate/TranslationService.kt:115-117 | app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationService.kt:75-78 β These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 Β· Code DuplicationΒ· Edited copies of one member (4 members, 8+ corresponding lines) Β· Γ1
Edited copies of one member (4 members, 8+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:544β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:544-552 | app/src/main/kotlin/com/chmouel/liseur/companion/CompanionViewModel.kt:400-407 | app/src/main/kotlin/com/chmouel/liseur/companion/StoryController.kt:252-259 | app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.kt:1195-1203 β These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 Β· Code DuplicationΒ· Edited copies of one member (4 members, 3+ corresponding lines) Β· Γ1
Edited copies of one member (4 members, 3+ corresponding lines) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:507β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:507-509 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:621-623 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:1070-1072 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncTranslations.kt:459-461 β These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (37 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:524β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:524-560 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:643-679 β before extracting anything, compare `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:524` 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 (28β31 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2303β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2303-2333 | app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/StyleParts.kt:89-116 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2303` 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 (26β30 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:561β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:561-590 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:687-712 β before extracting anything, compare `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:561` 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 (29 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:298β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:298-326 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:331-359 β before extracting anything, compare `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:298` 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, `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:297` calls `allRemote` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:329` 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 (21 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:711β app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:711-731 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:1525-1545 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:711` 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 (22 lines × 2) app/src/play/kotlin/com/chmouel/liseur/companion/GeminiCompanionService.kt:108β app/src/play/kotlin/com/chmouel/liseur/companion/GeminiCompanionService.kt:108-129 | app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationService.kt:177-198 β 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 (19 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/liseursync/WorkResolver.kt:267β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/WorkResolver.kt:267-285 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/WorkResolver.kt:483-501 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/liseursync/WorkResolver.kt:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11β18 lines × 6) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSettingsScreen.kt:110β app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSettingsScreen.kt:110-120 | app/src/main/kotlin/com/chmouel/liseur/translate/TranslationSettingsScreen.kt:183-193 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/HiddenBooksScreen.kt:56-66 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ReadingAppearanceScreen.kt:113-123 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/SettingsScreen.kt:148-165 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/WatchedFoldersScreen.kt:97-107 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSettingsScreen.kt:110` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows β the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run β a one-line delegation has no helper inside it to lift β so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15β18 lines × 4) app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.kt:230β app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.kt:230-244 | app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudSettingsScreen.kt:187-201 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ReadingNavigationScreen.kt:134-151 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:179-195 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/providers/ServicesScreen.kt:230` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows β the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run β a one-line delegation has no helper inside it to lift β so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names β the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18 lines × 2) app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt:1227β app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt:1227-1244 | app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1209-1226 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt:1227` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows β the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run β a one-line delegation has no helper inside it to lift β so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:220β app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:220-236 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:548-564 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:220` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16β17 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1160β app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1160-1175 | app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1180-1196 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/library/SettingsBackupRepository.kt:1160` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows β the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run β a one-line delegation has no helper inside it to lift β so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names β the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15β17 lines × 2) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ContentsScreen.kt:237β app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ContentsScreen.kt:237-253 | app/src/main/kotlin/com/chmouel/liseur/reader/search/SearchScreen.kt:169-183 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ContentsScreen.kt:237` 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, `app/src/main/kotlin/com/chmouel/liseur/reader/search/SearchScreen.kt:165` calls `hits` and `app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ContentsScreen.kt:233` 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 (15β16 lines × 3) app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:304β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:304-319 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:337-352 | app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:363-377 β before extracting anything, compare `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:304` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15β18 lines × 2) app/src/main/kotlin/com/chmouel/liseur/companion/ServerCompanionService.kt:181β app/src/main/kotlin/com/chmouel/liseur/companion/ServerCompanionService.kt:181-198 | app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationService.kt:319-333 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/companion/ServerCompanionService.kt:181` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names β the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt:614β app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt:614-629 | app/src/main/kotlin/com/chmouel/liseur/data/db/SyncPeerState.kt:204-219 β the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach β a file they already depend on, or a new one alongside them β and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt:614` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows β the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run β a one-line delegation has no helper inside it to lift β so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11β16 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2523β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2523-2533 | app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2569-2584 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:2523` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names β the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14β15 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitUrl.kt:40β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitUrl.kt:40-53 | app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaUrl.kt:32-46 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitUrl.kt:40` it runs out through the closing brace of the declaration holding it β the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied β no decision has to be handed back and re-acted on. β These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitUrl.kt:38` calls `stripApiSuffix` and `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaUrl.kt:31` 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β15 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/calibre/CalibreUrl.kt:20β app/src/main/kotlin/com/chmouel/liseur/data/calibre/CalibreUrl.kt:20-30 | app/src/main/kotlin/com/chmouel/liseur/data/remote/RemoteUrl.kt:43-57 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. 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 (11β14 lines × 2) app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:302β app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:302-312 | app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:663-676 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt:302` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows β the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run β a one-line delegation has no helper inside it to lift β so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12β14 lines × 2) app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationOptions.kt:158β app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationOptions.kt:158-169 | app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudSettingsScreen.kt:425-438 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/translate/ServerTranslationOptions.kt:158` 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) app/src/main/kotlin/com/chmouel/liseur/ui/UploadBookOfferDialog.kt:48β app/src/main/kotlin/com/chmouel/liseur/ui/UploadBookOfferDialog.kt:48-61 | app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1485-1497 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/UploadBookOfferDialog.kt:48` 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β13 lines × 2) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:691β app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:691-703 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:1338-1349 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 3) app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:722β app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:722-733 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:797-808 | app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:1536-1547 β all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites β resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt:722` 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β10 lines × 2) app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:2040β app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:2040-2049 | app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:2149-2156 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/reader/ReaderScreen.kt:2040` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9β10 lines × 2) app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReadingProgressUi.kt:1078β app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReadingProgressUi.kt:1078-1087 | app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReadingProgressUi.kt:1161-1169 β both copies are in the same file, so extract the block into one function there and call it from each site β the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/com/chmouel/liseur/reader/chrome/ReadingProgressUi.kt:1078` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names β the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8β9 lines × 2) app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationClient.kt:296β app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationClient.kt:296-303 | app/src/play/kotlin/com/chmouel/liseur/tts/GeminiTtsClient.kt:229-237 β the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach β a location they all depend on today, or a new shared one if there is none β and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/kotlin/com/chmouel/liseur/tts/GeminiTtsClient.kt:229` it does not close everything it opens, so those exact lines cannot be lifted as they stand β widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 3) app/src/main/kotlin/com/chmouel/liseur/reader/SelectionHandleFix.kt:277β app/src/main/kotlin/com/chmouel/liseur/reader/SelectionHandleFix.kt:277-285 | app/src/main/kotlin/com/chmouel/liseur/reader/WideContentFit.kt:119-127 | app/src/main/kotlin/com/chmouel/liseur/reader/footnotes/FootnoteLayout.kt:336-344 β 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 (10 lines × 4 locations) promo/src/scenes/companion.tsx:5β promo/src/scenes/companion.tsx:5 · promo/src/scenes/library.tsx:5 · promo/src/scenes/outro.tsx:3 · promo/src/scenes/reading.tsx:5 β the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block β it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead β the whole function, component or branch these lines sit in β and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 4 locations) promo/src/scenes/aloud.tsx:3β promo/src/scenes/aloud.tsx:3 · promo/src/scenes/companion.tsx:3 · promo/src/scenes/library.tsx:3 · promo/src/scenes/reading.tsx:3 β the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block β it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead β the whole function, component or branch these lines sit in β and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 6 locations) promo/src/scenes/companion.tsx:5β promo/src/scenes/companion.tsx:5 · promo/src/scenes/intro.tsx:3 · promo/src/scenes/library.tsx:5 · promo/src/scenes/outro.tsx:3 · +2 more site(s) not listed β the 6 copies are spread across 6 files, and the CITED SPAN is not a self-contained block β it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead β the whole function, component or branch these lines sit in β and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) promo/src/scenes/intro.tsx:6β promo/src/scenes/intro.tsx:6 · promo/src/scenes/outro.tsx:6 β the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block β it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead β the whole function, component or branch these lines sit in β and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 3 locations) promo/src/scenes/intro.tsx:2β promo/src/scenes/intro.tsx:2 · promo/src/scenes/sync.tsx:4 · promo/src/scenes/translation.tsx:3 β the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block β it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead β the whole function, component or branch these lines sit in β and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Unused dependency '@ffprobe-installer/ffprobe' promo/package.json:26β Declared in promo/package.json but never imported anywhere in that package or its workspace members β no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@revideo/ui' promo/package.json:19β Declared in promo/package.json but never imported anywhere in that package or its workspace members β no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Minor β 107 finding(s)
DM2 Β· Strongly-typed idsΒ· Primitive id on a domain type Β· Γ40
Primitive id on a domain type: ChapterRecapRow.unitKey app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:34β `ChapterRecapRow.unitKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: ChapterRecapRow.serverId app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:37β `ChapterRecapRow.serverId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: RecapPartRow.unitKey app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:49β `RecapPartRow.unitKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: RecapPartRow.serverId app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:53β `RecapPartRow.serverId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: RecapQueueRow.unitKey app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:64β `RecapQueueRow.unitKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: AnnotationSync.peerId app/src/main/kotlin/com/chmouel/liseur/data/db/AnnotationSync.kt:40β `AnnotationSync.peerId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: AnnotationSync.bookId app/src/main/kotlin/com/chmouel/liseur/data/db/AnnotationSync.kt:42β `AnnotationSync.bookId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: AnnotationSync.workId app/src/main/kotlin/com/chmouel/liseur/data/db/AnnotationSync.kt:43β `AnnotationSync.workId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: Book.browseServerId app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:75β `Book.browseServerId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that.
Primitive id on a domain type: Book.remoteBookId app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:76β `Book.remoteBookId` is a raw `Int` β give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that.
Primitive id on a domain type: Book.workId app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:93β `Book.workId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: Book.seriesId app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:142β `Book.seriesId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: Book.catalogFolderId app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:162β `Book.catalogFolderId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: Book.shelfSeriesId app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:252β `Book.shelfSeriesId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: BookAnnotation.bookId app/src/main/kotlin/com/chmouel/liseur/data/db/BookAnnotation.kt:33β `BookAnnotation.bookId` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: BookOrbitBinding.accountKey app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitBinding.kt:39β `BookOrbitBinding.accountKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: BookOrbitBinding.bookId app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitBinding.kt:43β `BookOrbitBinding.bookId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that.
Primitive id on a domain type: BookOrbitBinding.fileId app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitBinding.kt:45β `BookOrbitBinding.fileId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that.
Primitive id on a domain type: BookOrbitCfiRecord.accountKey app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitCfiRecord.kt:25β `BookOrbitCfiRecord.accountKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: BookOrbitCfiRecord.bookId app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitCfiRecord.kt:27β `BookOrbitCfiRecord.bookId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that.
Primitive id on a domain type: BookOrbitCfiRecord.fileId app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitCfiRecord.kt:28β `BookOrbitCfiRecord.fileId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that.
Primitive id on a domain type: BookOrbitLocalCfi.accountKey app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitLocalCfi.kt:33β `BookOrbitLocalCfi.accountKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Primitive id on a domain type: BookOrbitLocalCfi.bookId app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitLocalCfi.kt:35β `BookOrbitLocalCfi.bookId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that.
Primitive id on a domain type: BookOrbitLocalCfi.fileId app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitLocalCfi.kt:36β `BookOrbitLocalCfi.fileId` is a raw `Long` β give it a strongly-typed id: a dedicated single-field type wrapping the `Long`, in whatever form your language spells that.
Primitive id on a domain type: BookOrbitPositionAgreement.accountKey app/src/main/kotlin/com/chmouel/liseur/data/db/BookOrbitPositionAgreement.kt:26β `BookOrbitPositionAgreement.accountKey` is a raw `String` β give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/domain/BookBackup.kt:28β `!bookId.isNullOrBlank() && ids.add(bookId)` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/domain/BookBackup.kt, app/src/main/kotlin/com/chmouel/liseur/domain/ReadingPositionBackup.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCfiRepository.kt:301β `!context.request.matches(database.remoteServerDao().get()) || !context.matches(database.bookOrbitBindingDao().get(context.request.accountKeyβ¦` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitCfiRepository.kt, app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitPositionAgreement.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt:1909β `!state.isSearchActive && !state.filters.archived` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt, app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/ShelvesLibrary.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt:684β `agreedProgression == null && agreedStatus == null` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt, app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/tts/SpeechLocalNetworkPrompt.kt:64β `asked && activity?.shouldShowRequestPermissionRationale(LocalNetworkAccess.PERMISSION) == false` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/tts/SpeechLocalNetworkPrompt.kt, app/src/main/kotlin/com/chmouel/liseur/ui/settings/ServerAccountScreen.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt:1192β `book.finished || book.url in state.inProgressBooks` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/MainActivity.kt, app/src/main/kotlin/com/chmouel/liseur/ui/library/LibraryScreen.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/domain/LibraryFilters.kt:183β `book.openableUrl != null || book.downloadState == DownloadState.DOWNLOADED` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/domain/LibraryFilters.kt, app/src/main/kotlin/com/chmouel/liseur/domain/SeriesShelf.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationClient.kt:287β `code == 429 || status == "RESOURCE_EXHAUSTED"` appears character-identically in 2 files β app/src/play/kotlin/com/chmouel/liseur/translate/GeminiTranslationClient.kt, app/src/play/kotlin/com/chmouel/liseur/tts/GeminiTtsClient.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/ShelvesLibrary.kt:618β `download == null && progression.isUnderway(book)` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/ShelvesLibrary.kt, app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/StyleParts.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitSession.kt:96β `expectedAccountKey != null && server.accountKey != expectedAccountKey` appears character-identically in 3 files β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitSession.kt, app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt, app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:109β `failure == null || reason == SyncFailure.Unauthorised || (failure != SyncFailure.Unauthorised && (reason == SyncFailure.Forbidden || reason β¦` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt, app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncTranslations.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt:55β `format && application && hasBooks && reader.peek() == JsonToken.END_DOCUMENT` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/domain/SessionBackup.kt, app/src/main/kotlin/com/chmouel/liseur/domain/TranslationBackup.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:1071β `it.accountKey == peer.accountKey && it.credentials == peer.credentials` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt, app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncTranslations.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:508β `it.accountKey == server.accountKey && it.addedAt == server.addedAt` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt, app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/reader/SelectionBlock.kt:43β `it.isNotBlank() && it.length <= MAX_SELECTOR` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/reader/SelectionBlock.kt, app/src/main/kotlin/com/chmouel/liseur/reader/progress/ExactLocatorAnchor.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/companion/Investigation.kt:451β `it.isNotEmpty() && it.length <= MAX_CLAIM` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/companion/Investigation.kt, app/src/main/kotlin/com/chmouel/liseur/companion/Reimmersion.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitDeleteClient.kt:43β `it.kind == ServerKind.BOOKORBIT && RemoteUrl.sameAddress(it.baseUrl, baseUrl)` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitDeleteClient.kt, app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitUploadClient.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/library/TranslationBackupRepository.kt:36β `it.state == "done" || it.state == "restored"` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/data/library/TranslationBackupRepository.kt, app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloadRepository.kt:189β `it.state == WorkInfo.State.RUNNING || it.state == WorkInfo.State.ENQUEUED` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloadRepository.kt, app/src/main/kotlin/com/chmouel/liseur/data/remote/BookUploadRepository.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/opds/OpdsParser.kt:856β `node.nodeType == Node.TEXT_NODE || node.nodeType == Node.CDATA_SECTION_NODE` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/data/opds/OpdsParser.kt, app/src/main/kotlin/com/chmouel/liseur/reader/progress/BookOrbitIncomingAnchor.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt:309β `outcome.failure != null && firstFailure == null` appears character-identically in 3 files β app/src/main/kotlin/com/chmouel/liseur/data/calibre/KoboSyncRepository.kt, app/src/main/kotlin/com/chmouel/liseur/data/komga/KomgaSyncRepository.kt, app/src/main/kotlin/com/chmouel/liseur/data/kosync/KosyncPositionSync.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/domain/ReadingStateMerge.kt:42β `progression == null || progression <= 0.0` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/domain/ReadingStateMerge.kt, app/src/main/kotlin/com/chmouel/liseur/ui/library/styles/ListLibrary.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt:114β `reason is SyncFailure.ServerError && reason.code == 429` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncAnnotations.kt, app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncTranslations.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt:2280β `rejection.code == LiseurSyncHttp.TOO_LARGE || rejection.errorCode == LiseurSyncRejection.BATCH_TOO_LARGE` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncPositionSync.kt, app/src/main/kotlin/com/chmouel/liseur/data/liseursync/WorkResolver.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/kotlin/com/chmouel/liseur/data/calibre/CalibreDeleteClient.kt:39β `response.code == 401 || response.code == 403` appears character-identically in 2 files β app/src/main/kotlin/com/chmouel/liseur/data/calibre/CalibreDeleteClient.kt, app/src/main/kotlin/com/chmouel/liseur/data/opds/OpdsSetupClient.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.
Fat interface: CompanionRecapDao (44 abstract methods) app/src/main/kotlin/com/chmouel/liseur/companion/CompanionStore.kt:102β `CompanionRecapDao` declares 44 abstract methods: `recaps`, `watchRecaps`, `recap`, `touch`, `putRecap`, `firstBackupPage`, `nextBackupPage`, `restoreRecap`, `forgetOtherRecaps`, `parts`, `putPart`, `forgetParts`, `forgetOtherParts`, `queued`, `enqueue`, `dequeue`, `forgetOtherQueued`, `clearQueueFollowingSettings`, `turnedOn`, `choice`, `putChoice`, `summary`, `summariesAt`, `touchSummary`, `putSummary`, `restoreSummary`, `forgetOtherSummaries`, `forgetSummaries`, `summaryCount`, `summaryCharacters`, `oldestSummaries`, `forgetSummary`, `firstSummaryPage`, `nextSummaryPage`, `books`, `forgetRecaps`, `forgetQueued`, `forgetChoices`, `recapCount`, `recapCharacters`, and 4 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: BookDao (60 abstract methods) app/src/main/kotlin/com/chmouel/liseur/data/db/Book.kt:279β `BookDao` declares 60 abstract methods: `observeAll`, `allOnce`, `observeMostRecent`, `mostRecentlyOpened`, `continuationCandidates`, `getByUrl`, `observeByUrl`, `getByUrls`, `presentUrls`, `worksByUrl`, `setArchived`, `allRemote`, `fromBrowseServer`, `observeFromBrowseServer`, `undownloadedFromBrowseServer`, `unlinkDownloadedFromBrowseServerRows`, `forgetUnlinkedCatalogMetadata`, `moveToBrowseServer`, `rescopeRemote`, `moveRemoteToBrowseServer`, `allOpenable`, `remoteNotDownloadedUrls`, `unlinkDownloadedFromRemoteRows`, `unlinkFromRemoteRows`, `markCatalogMissing`, `clearCatalogMissing`, `booksForSource`, `setDownloadState`, `markDownloaded`, `updateAuthor`, `needingAuthorCheck`, `refreshIndexedFile`, `needingSeriesCheck`, `needingMetadataCheck`, `setFileMetadataChecked`, `fillSeriesFromFile`, `setSeriesOverride`, `acknowledgeSeriesClaim`, `updatePendingSeriesClaimRevision`, `pendingSeriesClaims`, and 20 more. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: LiseurDatabase (31 abstract methods) app/src/main/kotlin/com/chmouel/liseur/data/db/LiseurDatabase.kt:51β `LiseurDatabase` declares 31 abstract methods: `readingProgressDao`, `furthestPositionDao`, `readingSessionDao`, `syncPeerStateDao`, `workIdentityDao`, `bookDao`, `seriesOrderDao`, `libraryFolderDao`, `remoteServerDao`, `kosyncPeerDao`, `annotationDao`, `annotationSyncDao`, `typographyDao`, `bookScreenDao`, `bookReadingModeDao`, `seriesExtraDao`, `uploadRefusalDao`, `sessionRefusalDao`, `sessionTransmissionDao`, `starterCatalogProgressDao`, `bookOrbitBindingDao`, `bookOrbitCfiDao`, `bookOrbitLocalCfiDao`, `bookOrbitPositionAgreementDao`, `bookOrbitPositionTraversalDao`, `bookOrbitStatusAgreementDao`, `remoteStatsDao`, `bookAiPreferencesDao`, `glossaryDao`, `bookMetadataDao`, `sessionImportSourceDao`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: ReadingProgressDao (31 abstract methods) app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingProgress.kt:205β `ReadingProgressDao` declares 31 abstract methods: `forget`, `get`, `resetPeak`, `adoptBookOrbitPosition`, `observe`, `getAll`, `firstBackupPage`, `nextBackupPage`, `restoreBackupReadAt`, `restoreBackupCoverage`, `observeReadAt`, `readAtOnce`, `observeProgressions`, `upsert`, `updateLocal`, `insertLocal`, `updatePending`, `insertPending`, `pendingFor`, `clearPending`, `currentRevision`, `renameRevision`, `renameStatusRevision`, `updateFinishedOverride`, `insertFinishedOverride`, `overrideFor`, `retireAccountState`, `retireStatusDebt`, `rekeyAccount`, `markDirtyFor`, `ownedByOther`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: ReadingSessionDao (25 abstract methods) app/src/main/kotlin/com/chmouel/liseur/data/db/ReadingSession.kt:82β `ReadingSessionDao` declares 25 abstract methods: `insert`, `insertAll`, `checkpoint`, `finish`, `openSessions`, `closeInterruptedSessions`, `get`, `observeAll`, `allOnce`, `closedForBackup`, `startedAtFor`, `idFor`, `rowById`, `importedRowsUnder`, `deleteById`, `reattachImportedSessions`, `observeTotalDuration`, `awaitingUpload`, `awaitingUploadTo`, `markUploaded`, `forgetUploads`, `forgetTransmissionEvidence`, `countForBook`, `deleteForBook`, `deleteForBooks`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: RemoteServerDao (19 abstract methods) app/src/main/kotlin/com/chmouel/liseur/data/db/RemoteServer.kt:332β `RemoteServerDao` declares 19 abstract methods: `observe`, `get`, `setPreferredFormat`, `observeBrowseServers`, `browseServers`, `nextBrowseId`, `upsert`, `setKoboTokenCipher`, `setCatalogSyncedAt`, `setPositionSyncedAt`, `setSyncToken`, `setCanDownload`, `setCanUpload`, `setCanReadInsights`, `setSyncCursor`, `rotateOrbitTokens`, `setOrbitEpoch`, `setAnnotationCursor`, `delete`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: SyncPeerStateDao (27 abstract methods) app/src/main/kotlin/com/chmouel/liseur/data/db/SyncPeerState.kt:101β `SyncPeerStateDao` declares 27 abstract methods: `get`, `hasPendingStatusForBook`, `forPeer`, `pendingFor`, `countPending`, `countForBook`, `upsert`, `updatePending`, `insertPending`, `clearPending`, `updatePendingStatus`, `insertPendingStatus`, `clearPendingStatus`, `updateStatusSent`, `insertStatusSent`, `clearStatusSent`, `acknowledgePositionRevision`, `insertPositionAcknowledgement`, `acknowledgeStatus`, `insertStatusAcknowledgement`, `updateSettled`, `insertSettled`, `forget`, `forgetBooks`, `forgetPeer`, `countForPeer`, `rekeyPeer`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: WorkIdentityDao (28 abstract methods) app/src/main/kotlin/com/chmouel/liseur/data/db/WorkIdentity.kt:147β `WorkIdentityDao` declares 28 abstract methods: `fingerprint`, `observeFingerprint`, `upsert`, `alias`, `observeAwaitingAnswer`, `reject`, `observeAmbiguityCount`, `aliasesFor`, `observeAliases`, `deleteAliasIfStale`, `confirm`, `markSeeded`, `markAnnotationsReconciled`, `raiseFurthestFloor`, `furthestFloor`, `forgetAnnotationReconciliation`, `ambiguitiesFor`, `ambiguityCount`, `clearAmbiguity`, `forgetFingerprints`, `forgetAliases`, `namingCountForBook`, `forgetAmbiguities`, `forgetPeerAliases`, `forgetPeerAmbiguities`, `countForPeer`, `rekeyAliases`, `rekeyAmbiguities`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: TranslatedSentenceDao (23 abstract methods) app/src/main/kotlin/com/chmouel/liseur/translate/SavedTranslations.kt:73β `TranslatedSentenceDao` declares 23 abstract methods: `find`, `findAll`, `touch`, `put`, `putPulled`, `refreshPulled`, `unsynced`, `lastSaved`, `maxSavedAt`, `count`, `cacheCount`, `cacheCharacters`, `keptBytes`, `forExport`, `exportPage`, `counted`, `characters`, `oldest`, `drop`, `dropOldest`, `books`, `forget`, `clear`. 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.
Silent fallback default on parse failure app/src/main/kotlin/com/chmouel/liseur/data/liseursync/LiseurSyncLive.kt:44β `liveTopics` answers `emptySet()` when `JSONException` is thrown, with no log or throw β a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default on parse failure app/src/main/kotlin/com/chmouel/liseur/data/settings/ServerSettings.kt:210β `states` answers `emptyMap()` when `IllegalArgumentException` is thrown, with no log or throw β a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default on parse failure app/src/main/kotlin/com/chmouel/liseur/data/settings/ServerSettings.kt:362β `companionStates` answers `emptyMap()` when `IllegalArgumentException` is thrown, with no log or throw β a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default on parse failure app/src/main/kotlin/com/chmouel/liseur/data/settings/ServerSettings.kt:369β `translationStates` answers `emptyMap()` when `IllegalArgumentException` is thrown, with no log or throw β a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default on parse failure app/src/main/kotlin/com/chmouel/liseur/data/settings/VoicePreferences.kt:36β `decode` answers `emptyList()` when `JSONException` is thrown, with no log or throw β a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default on parse failure .claude/skills/play-policy-insights/scripts/generate_report.py:289β `finding_sort_key` (in `aggregate_findings`) returns `0` when `(ValueError, TypeError)` is raised, with no log or raise β a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch app/src/main/kotlin/com/chmouel/liseur/data/calibre/BookDownloadRepository.kt:444β `freeBytes` swallows every exception into `0L` β a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/kotlin/com/chmouel/liseur/data/library/SvgCover.kt:127β `svgImageHrefs` swallows every exception into `emptyList()` β a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch app/src/main/kotlin/com/chmouel/liseur/ui/settings/LicencesScreen.kt:234β `LicenceDialog` swallows every exception into `""` β a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
D20 Β· ADR QualityΒ· ADR still proposed, but the code already adopted it Β· Γ2
ADR still proposed, but the code already adopted it docs/adr/0003-read-aloud-tts.md:3β docs/adr/0003-read-aloud-tts.md:3 says "proposed", but the production code already uses every element its Decision names: `TtsNavigator` (app/src/main/kotlin/com/chmouel/liseur/tts/ReadAloudPlayback.kt), `TextToSpeech` (app/src/main/kotlin/com/chmouel/liseur/tts/DeviceSpeechService.kt). A proposal the code has adopted is a decision in force; mark it accepted, or, if the code should not do this, say so.
ADR still proposed, but the code already adopted it docs/adr/0058-codex-hosts-the-character-profile.md:3β docs/adr/0058-codex-hosts-the-character-profile.md:3 says "proposed", but the production code already uses every element its Decision names: `CodexStore.FORMAT` (app/src/main/kotlin/com/chmouel/liseur/companion/CompanionViewModel.kt), `PassageText.VERSION` (app/src/main/kotlin/com/chmouel/liseur/companion/CompanionSheet.kt). A proposal the code has adopted is a decision in force; mark it accepted, or, if the code should not do this, say so.
C4 Β· Data RetentionΒ· Partial data-retention evidence Β· Γ1
Partial data-retention evidence β A retention mechanism is present, but the data-lifecycle is not yet complete β missing: a scheduled purge / cleanup job (a periodic worker or scheduled task that deletes rows past their retention β @Query("DELETE β¦ WHERE createdAt < :cutoff"), deleteWhere { createdAt less cutoff }, purgeExpiredβ¦ / deleteOldβ¦), a documented retention period / data-expiry.
D20 Β· ADR QualityΒ· ADR declares no status Β· Γ1
ADR declares no status docs/adr/0039-the-widget-borrows-the-dashboards-other-devices.md:1β `docs/adr/0039-the-widget-borrows-the-dashboards-other-devices.md` declares no status, while 73 of the 73 other records in `docs/adr` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
D20 Β· ADR QualityΒ· ADR has no Consequences section Β· Γ1
ADR has no Consequences section docs/adr/0066-choosing-an-opds-download-format.md:1β docs/adr/0066-choosing-an-opds-download-format.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D26 Β· Project CohesionΒ· Projects may be oversized for their cohesion Β· Γ1
Projects may be oversized for their cohesion app/build.gradle.kts:1β `app` (150596 LoC, 2778 module-visible types across 56 directories) overshoots its size bounds. 1 of 3 build unit(s) (Gradle, npm) overshoot their size bounds, lowering Project Cohesion to 3.3/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.
P3 Β· Security & performance toolingΒ· No SAST Β· Γ1
No SAST REDACTED:6β No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 4 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen β if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 Β· Security & performance toolingΒ· Dependabot does not watch npm Β· Γ1
Dependabot does not watch npm REDACTED:2β `REDACTED` schedules updates, but no `package-ecosystem` entry covers `npm`, which this tree depends on β so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list.
X2 Β· Cancellation propagationΒ· Not all suspend functions that make a request accept the coroutine's cancellation Β· Γ1
Not all suspend functions that make a request accept the coroutine's cancellation β Only 0/15 suspend functions that make a cancellable request (Ktor, OkHttp newCall, URL streams) accept the coroutine's cancellation or pass one on, so a request keeps running after whatever wanted it has given up β a screen navigated away from, a disposed widget, a superseded search. In a suspend function, make the request with a call that suspends β Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` that cancels the `Call` β not a blocking `execute()`: `withContext(Dispatchers.IO)` moves the call off the caller's thread but does not make it cancellable; where nothing could ever cancel the call, omitting it is a deliberate choice β judge against how the function is used.
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.
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 53 file(s) β `app/src/main/kotlin/com/chmouel/liseur/companion/CompanionFailureView.kt`, `app/src/main/kotlin/com/chmouel/liseur/companion/Investigation.kt`, `app/src/main/kotlin/com/chmouel/liseur/companion/StoryTab.kt`, `app/src/main/kotlin/com/chmouel/liseur/data/NetworkAvailability.kt`, `app/src/main/kotlin/com/chmouel/liseur/data/bookorbit/BookOrbitAdoptedSource.kt`, β¦ (+48 more) β so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable β No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable β No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable β No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable β No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1e733-c954-7cdd-b6dd-b1dbb8ce1eb5 Β· every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 12 Β· Warnings: 857 Β· Recommendations: 107 Β· Info: 124 β Appendix A Β· all findings Β· full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 01:51 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.