Public report of ZeroPointSix/empathize-with-others, 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, 13:56 UTC · Survey ID cd_92b60b5ef9c0434f8fdfcdca2418f0b9
ZeroPointSix/empathize-with-others
Measured 17 November 2026, 13:55 UTC, at code version 6792ab7
First survey, so nothing to compare with yet
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 108,925 lines of product code in 6 projects, tests not counted · Estimated rebuild effort: about 1.3 person-years · Weakest lens: Accessibility, 35.5
Findings by how serious they are
167 critical585 serious508 minor
11 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, 13:55 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 ▸
55of 55 dimensions measured by tools.
1247of 1260 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
55dimensions across 8 lenses, read from 108,925 lines of product code in 6 projects.
ZeroPointSix/empathize-with-others falls short of our standard for production because it has controls that only work with a mouse. It scores 45.0 out of 100 and is rated Weak, and 113 of its 167 critical findings are security problems.
Accessibility, at 35.5, is the weakest lens and counts most in the score. The best first step is making the controls keyboard-usable, worth about 6.8 points. Fixing the package under a licence on your banned list comes next, worth about 2.5 points. Raising Accessibility to 70 would lift the score to about 52.7.
Ninety passwords or keys in the code and ten in the code's history are open to anyone who can read the repository. Twenty-three controls can't be used without a mouse, and eight pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Making the controls work with a keyboard, replacing each exposed password or key and pinning each tool to an exact version would close these risks. Passing outside input through environment variables would fix the two pipeline steps that put outside input straight into a shell command, and setting a waiting period for automatic updates would deal with the automatic dependency update that takes a new release at once. The 13 pages that don't say their language need their language set.
The product code is 108,925 lines, about €180,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 35.5 to 70, the lowest score rated Strong, the score would rise from 45.0 to about 52.7.
Code composition: what the lines of code are
Product code 61%Tests 39%
Rebuild cost: about €180,000 · Estimate
Cost to rebuild
€61,000 to €310,000, for 1,013 to 3,215 hours of work, about 1.3 person-years for 1 to 3 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 45. 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: 108,925 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
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 6.8 points · Medium effort · Keyboard semantics
2
Resolve the 1 Banned license finding(s) in License Compliance.
Resolve the 90 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (90).
Raises the score by about 5.0 points · Medium effort · REDACTED Scanning
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €180,000 to build again, about 1.3 person-years of work. Its weakest lens is Accessibility, at 35.5 (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.
If you do one thing first · First action
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. Of all the actions in this report, it raises the score most for the work it takes: about 6.8 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.3 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 1,166,491 lines over the last 90 days, which is about 4,730,769 lines a year. At that pace, the extra work comes to an estimated 236.5 to 1576.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
297 modules, with 315 dependencies between them. 2 loops run through 11 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 257 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.
data.local.entity uses domain.model, so a change to domain.model can break data.local.entity, while a change to data.local.entity can't break domain.model.
Position
Below the diagonal: data.local.entity uses a module listed above it, which is the healthy direction.
data.remote.api uses data.remote.model, so a change to data.remote.model can break data.remote.api, while a change to data.remote.api can't break data.remote.model.
Position
Below the diagonal: data.remote.api uses a module listed above it, which is the healthy direction.
domain.model.PromptValidationResult uses domain.model, so a change to domain.model can break domain.model.PromptValidationResult, while a change to domain.model.PromptValidationResult can't break domain.model.
Position
Below the diagonal: domain.model.PromptValidationResult uses a module listed above it, which is the healthy direction.
41 pairs of types, where a type in domain.repository uses a type in domain.model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
domain.repository uses domain.model, so a change to domain.model can break domain.repository, while a change to domain.repository can't break domain.model.
Position
Below the diagonal: domain.repository uses a module listed above it, which is the healthy direction.
domain.usecase.ManualSummaryUseCase uses domain.model, so a change to domain.model can break domain.usecase.ManualSummaryUseCase, while a change to domain.usecase.ManualSummaryUseCase can't break domain.model.
Position
Below the diagonal: domain.usecase.ManualSummaryUseCase uses a module listed above it, which is the healthy direction.
domain.util.SystemPrompts uses domain.model, so a change to domain.model can break domain.util.SystemPrompts, while a change to domain.util.SystemPrompts can't break domain.model.
Position
Below the diagonal: domain.util.SystemPrompts uses a module listed above it, which is the healthy direction.
presentation.navigation uses domain.model, so a change to domain.model can break presentation.navigation, while a change to presentation.navigation can't break domain.model.
Position
Below the diagonal: presentation.navigation uses a module listed above it, which is the healthy direction.
presentation.theme uses domain.model, so a change to domain.model can break presentation.theme, while a change to presentation.theme can't break domain.model.
Position
Below the diagonal: presentation.theme uses a module listed above it, which is the healthy direction.
presentation.ui.screen.advisor uses domain.model, so a change to domain.model can break presentation.ui.screen.advisor, while a change to presentation.ui.screen.advisor can't break domain.model.
Position
Below the diagonal: presentation.ui.screen.advisor uses a module listed above it, which is the healthy direction.
13→35 presentation.ui.screen.advisor uses presentation.viewmodelpart of a loop✕
Connections
4 pairs of types, where a type in presentation.ui.screen.advisor uses a type in presentation.viewmodel.
presentation.ui.screen.advisor uses presentation.viewmodel, so a change to presentation.viewmodel can break presentation.ui.screen.advisor, while a change to presentation.ui.screen.advisor can't break presentation.viewmodel.
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.
presentation.ui.screen.chat uses domain.model, so a change to domain.model can break presentation.ui.screen.chat, while a change to presentation.ui.screen.chat can't break domain.model.
Position
Below the diagonal: presentation.ui.screen.chat uses a module listed above it, which is the healthy direction.
14→35 presentation.ui.screen.chat uses presentation.viewmodelpart of a loop✕
Connections
1 pair of types, where a type in presentation.ui.screen.chat uses a type in presentation.viewmodel.
presentation.ui.screen.chat uses presentation.viewmodel, so a change to presentation.viewmodel can break presentation.ui.screen.chat, while a change to presentation.ui.screen.chat can't break presentation.viewmodel.
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.
presentation.ui.screen.contact uses domain.model, so a change to domain.model can break presentation.ui.screen.contact, while a change to presentation.ui.screen.contact can't break domain.model.
Position
Below the diagonal: presentation.ui.screen.contact uses a module listed above it, which is the healthy direction.
15→35 presentation.ui.screen.contact uses presentation.viewmodelpart of a loop✕
Connections
6 pairs of types, where a type in presentation.ui.screen.contact uses a type in presentation.viewmodel.
presentation.ui.screen.contact uses presentation.viewmodel, so a change to presentation.viewmodel can break presentation.ui.screen.contact, while a change to presentation.ui.screen.contact can't break presentation.viewmodel.
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.
presentation.ui.screen.contact.factstream uses domain.model, so a change to domain.model can break presentation.ui.screen.contact.factstream, while a change to presentation.ui.screen.contact.factstream can't break domain.model.
Position
Below the diagonal: presentation.ui.screen.contact.factstream uses a module listed above it, which is the healthy direction.
presentation.ui.screen.prompt uses domain.model, so a change to domain.model can break presentation.ui.screen.prompt, while a change to presentation.ui.screen.prompt can't break domain.model.
Position
Below the diagonal: presentation.ui.screen.prompt uses a module listed above it, which is the healthy direction.
17→35 presentation.ui.screen.prompt uses presentation.viewmodelpart of a loop✕
Connections
1 pair of types, where a type in presentation.ui.screen.prompt uses a type in presentation.viewmodel.
presentation.ui.screen.prompt uses presentation.viewmodel, so a change to presentation.viewmodel can break presentation.ui.screen.prompt, while a change to presentation.ui.screen.prompt can't break presentation.viewmodel.
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.
presentation.ui.screen.settings uses domain.model, so a change to domain.model can break presentation.ui.screen.settings, while a change to presentation.ui.screen.settings can't break domain.model.
Position
Below the diagonal: presentation.ui.screen.settings uses a module listed above it, which is the healthy direction.
18→35 presentation.ui.screen.settings uses presentation.viewmodelpart of a loop✕
Connections
5 pairs of types, where a type in presentation.ui.screen.settings uses a type in presentation.viewmodel.
presentation.ui.screen.settings uses presentation.viewmodel, so a change to presentation.viewmodel can break presentation.ui.screen.settings, while a change to presentation.ui.screen.settings can't break presentation.viewmodel.
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.
presentation.ui.screen.tag uses domain.model, so a change to domain.model can break presentation.ui.screen.tag, while a change to presentation.ui.screen.tag can't break domain.model.
Position
Below the diagonal: presentation.ui.screen.tag uses a module listed above it, which is the healthy direction.
19→35 presentation.ui.screen.tag uses presentation.viewmodelpart of a loop✕
Connections
1 pair of types, where a type in presentation.ui.screen.tag uses a type in presentation.viewmodel.
presentation.ui.screen.tag uses presentation.viewmodel, so a change to presentation.viewmodel can break presentation.ui.screen.tag, while a change to presentation.ui.screen.tag can't break presentation.viewmodel.
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.
presentation.ui.screen.userprofile uses domain.model, so a change to domain.model can break presentation.ui.screen.userprofile, while a change to presentation.ui.screen.userprofile can't break domain.model.
Position
Below the diagonal: presentation.ui.screen.userprofile uses a module listed above it, which is the healthy direction.
20→35 presentation.ui.screen.userprofile uses presentation.viewmodelpart of a loop✕
Connections
1 pair of types, where a type in presentation.ui.screen.userprofile uses a type in presentation.viewmodel.
presentation.ui.screen.userprofile uses presentation.viewmodel, so a change to presentation.viewmodel can break presentation.ui.screen.userprofile, while a change to presentation.ui.screen.userprofile can't break presentation.viewmodel.
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.local.dao uses data.local.entity, so a change to data.local.entity can break data.local.dao, while a change to data.local.dao can't break data.local.entity.
Position
Below the diagonal: data.local.dao uses a module listed above it, which is the healthy direction.
41 pairs of types, where a type in domain.util uses a type in domain.model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
domain.util uses domain.util.FloatingWindowManager, so a change to domain.util.FloatingWindowManager can break domain.util, while a change to domain.util can't break domain.util.FloatingWindowManager.
Position
Below the diagonal: domain.util uses a module listed above it, which is the healthy direction.
domain.util uses domain.repository, so a change to domain.repository can break domain.util, while a change to domain.util can't break domain.repository.
Position
Below the diagonal: domain.util uses a module listed above it, which is the healthy direction.
domain.util uses domain.util.SystemPrompts, so a change to domain.util.SystemPrompts can break domain.util, while a change to domain.util can't break domain.util.SystemPrompts.
Position
Below the diagonal: domain.util uses a module listed above it, which is the healthy direction.
presentation.ui.component.persona uses presentation.theme, so a change to presentation.theme can break presentation.ui.component.persona, while a change to presentation.ui.component.persona can't break presentation.theme.
Position
Below the diagonal: presentation.ui.component.persona uses a module listed above it, which is the healthy direction.
domain.service uses domain.repository, so a change to domain.repository can break domain.service, while a change to domain.service can't break domain.repository.
Position
Below the diagonal: domain.service uses a module listed above it, which is the healthy direction.
presentation.util uses domain.util.FloatingWindowManager, so a change to domain.util.FloatingWindowManager can break presentation.util, while a change to presentation.util can't break domain.util.FloatingWindowManager.
Position
Below the diagonal: presentation.util uses a module listed above it, which is the healthy direction.
presentation.util uses domain.util, so a change to domain.util can break presentation.util, while a change to presentation.util can't break domain.util.
Position
Below the diagonal: presentation.util uses a module listed above it, which is the healthy direction.
util uses domain.util.FloatingWindowManager, so a change to domain.util.FloatingWindowManager can break util, while a change to util can't break domain.util.FloatingWindowManager.
Position
Below the diagonal: util uses a module listed above it, which is the healthy direction.
data.repository uses data.remote.model, so a change to data.remote.model can break data.repository, while a change to data.repository can't break data.remote.model.
Position
Below the diagonal: data.repository uses a module listed above it, which is the healthy direction.
41 pairs of types, where a type in data.repository uses a type in domain.model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
data.repository uses data.local.entity, so a change to data.local.entity can break data.repository, while a change to data.repository can't break data.local.entity.
Position
Below the diagonal: data.repository uses a module listed above it, which is the healthy direction.
data.repository uses data.remote.api, so a change to data.remote.api can break data.repository, while a change to data.repository can't break data.remote.api.
Position
Below the diagonal: data.repository uses a module listed above it, which is the healthy direction.
data.repository uses domain.repository, so a change to domain.repository can break data.repository, while a change to data.repository can't break domain.repository.
Position
Below the diagonal: data.repository uses a module listed above it, which is the healthy direction.
data.repository uses data.local.dao, so a change to data.local.dao can break data.repository, while a change to data.repository can't break data.local.dao.
Position
Below the diagonal: data.repository uses a module listed above it, which is the healthy direction.
73 pairs of types, where a type in domain.usecase uses a type in domain.model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
100 pairs of types, where a type in domain.usecase uses a type in domain.repository. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
domain.usecase uses domain.repository, so a change to domain.repository can break domain.usecase, while a change to domain.usecase can't break domain.repository.
Position
Below the diagonal: domain.usecase uses a module listed above it, which is the healthy direction.
domain.usecase uses domain.usecase.ManualSummaryUseCase, so a change to domain.usecase.ManualSummaryUseCase can break domain.usecase, while a change to domain.usecase can't break domain.usecase.ManualSummaryUseCase.
Position
Below the diagonal: domain.usecase uses a module listed above it, which is the healthy direction.
43 pairs of types, where a type in domain.usecase uses a type in domain.util. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
domain.usecase uses domain.service, so a change to domain.service can break domain.usecase, while a change to domain.usecase can't break domain.service.
Position
Below the diagonal: domain.usecase uses a module listed above it, which is the healthy direction.
presentation.ui.component.state uses domain.model, so a change to domain.model can break presentation.ui.component.state, while a change to presentation.ui.component.state can't break domain.model.
Position
Below the diagonal: presentation.ui.component.state uses a module listed above it, which is the healthy direction.
presentation.ui.component.state uses presentation.util, so a change to presentation.util can break presentation.ui.component.state, while a change to presentation.ui.component.state can't break presentation.util.
Position
Below the diagonal: presentation.ui.component.state uses a module listed above it, which is the healthy direction.
app uses domain.util.SystemPrompts, so a change to domain.util.SystemPrompts can break app, while a change to app can't break domain.util.SystemPrompts.
Position
Below the diagonal: app uses a module listed above it, which is the healthy direction.
55 pairs of types, where a type in presentation.viewmodel uses a type in domain.model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
presentation.viewmodel uses domain.model, so a change to domain.model can break presentation.viewmodel, while a change to presentation.viewmodel can't break domain.model.
Position
Below the diagonal: presentation.viewmodel uses a module listed above it, which is the healthy direction.
presentation.viewmodel uses domain.repository, so a change to domain.repository can break presentation.viewmodel, while a change to presentation.viewmodel can't break domain.repository.
Position
Below the diagonal: presentation.viewmodel uses a module listed above it, which is the healthy direction.
presentation.viewmodel uses domain.usecase.ManualSummaryUseCase, so a change to domain.usecase.ManualSummaryUseCase can break presentation.viewmodel, while a change to presentation.viewmodel can't break domain.usecase.ManualSummaryUseCase.
Position
Below the diagonal: presentation.viewmodel uses a module listed above it, which is the healthy direction.
presentation.viewmodel uses presentation.ui.screen.advisor, so a change to presentation.ui.screen.advisor can break presentation.viewmodel, while a change to presentation.viewmodel can't break presentation.ui.screen.advisor.
Position
Below the diagonal: presentation.viewmodel uses a module listed above it, which is the healthy direction.
presentation.viewmodel uses presentation.ui.screen.chat, so a change to presentation.ui.screen.chat can break presentation.viewmodel, while a change to presentation.viewmodel can't break presentation.ui.screen.chat.
Position
Below the diagonal: presentation.viewmodel uses a module listed above it, which is the healthy direction.
presentation.viewmodel uses presentation.ui.screen.contact, so a change to presentation.ui.screen.contact can break presentation.viewmodel, while a change to presentation.viewmodel can't break presentation.ui.screen.contact.
Position
Below the diagonal: presentation.viewmodel uses a module listed above it, which is the healthy direction.
presentation.viewmodel uses presentation.ui.screen.prompt, so a change to presentation.ui.screen.prompt can break presentation.viewmodel, while a change to presentation.viewmodel can't break presentation.ui.screen.prompt.
Position
Below the diagonal: presentation.viewmodel uses a module listed above it, which is the healthy direction.
presentation.viewmodel uses presentation.ui.screen.settings, so a change to presentation.ui.screen.settings can break presentation.viewmodel, while a change to presentation.viewmodel can't break presentation.ui.screen.settings.
Position
Below the diagonal: presentation.viewmodel uses a module listed above it, which is the healthy direction.
presentation.viewmodel uses presentation.ui.screen.tag, so a change to presentation.ui.screen.tag can break presentation.viewmodel, while a change to presentation.viewmodel can't break presentation.ui.screen.tag.
Position
Below the diagonal: presentation.viewmodel uses a module listed above it, which is the healthy direction.
presentation.viewmodel uses presentation.ui.screen.userprofile, so a change to presentation.ui.screen.userprofile can break presentation.viewmodel, while a change to presentation.viewmodel can't break presentation.ui.screen.userprofile.
Position
Below the diagonal: presentation.viewmodel uses a module listed above it, which is the healthy direction.
presentation.viewmodel uses domain.util, so a change to domain.util can break presentation.viewmodel, while a change to presentation.viewmodel can't break domain.util.
Position
Below the diagonal: presentation.viewmodel uses a module listed above it, which is the healthy direction.
84 pairs of types, where a type in presentation.viewmodel uses a type in domain.usecase. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
presentation.viewmodel uses domain.usecase, so a change to domain.usecase can break presentation.viewmodel, while a change to presentation.viewmodel can't break domain.usecase.
Position
Below the diagonal: presentation.viewmodel uses a module listed above it, which is the healthy direction.
35→37 presentation.viewmodel uses presentation.ui.screen.aiconfigpart of a loop✕
Connections
7 pairs of types, where a type in presentation.viewmodel uses a type in presentation.ui.screen.aiconfig.
presentation.viewmodel uses presentation.ui.screen.aiconfig, so a change to presentation.ui.screen.aiconfig can break presentation.viewmodel, while a change to presentation.viewmodel can't break presentation.ui.screen.aiconfig.
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.
presentation.ui.screen.aiconfig uses domain.model, so a change to domain.model can break presentation.ui.screen.aiconfig, while a change to presentation.ui.screen.aiconfig can't break domain.model.
Position
Below the diagonal: presentation.ui.screen.aiconfig uses a module listed above it, which is the healthy direction.
presentation.ui.screen.aiconfig uses presentation.viewmodel, so a change to presentation.viewmodel can break presentation.ui.screen.aiconfig, while a change to presentation.ui.screen.aiconfig can't break presentation.viewmodel.
Position
Below the diagonal: presentation.ui.screen.aiconfig uses a module listed above it, which is the healthy direction.
presentation.ui.screen.contact.summary uses domain.model, so a change to domain.model can break presentation.ui.screen.contact.summary, while a change to presentation.ui.screen.contact.summary can't break domain.model.
Position
Below the diagonal: presentation.ui.screen.contact.summary uses a module listed above it, which is the healthy direction.
presentation.ui.screen.contact.summary uses domain.usecase.ManualSummaryUseCase, so a change to domain.usecase.ManualSummaryUseCase can break presentation.ui.screen.contact.summary, while a change to presentation.ui.screen.contact.summary can't break domain.usecase.ManualSummaryUseCase.
Position
Below the diagonal: presentation.ui.screen.contact.summary uses a module listed above it, which is the healthy direction.
presentation.ui.screen.contact.summary uses presentation.viewmodel, so a change to presentation.viewmodel can break presentation.ui.screen.contact.summary, while a change to presentation.ui.screen.contact.summary can't break presentation.viewmodel.
Position
Below the diagonal: presentation.ui.screen.contact.summary uses a module listed above it, which is the healthy direction.
presentation.ui.component.dialog uses domain.model, so a change to domain.model can break presentation.ui.component.dialog, while a change to presentation.ui.component.dialog can't break domain.model.
Position
Below the diagonal: presentation.ui.component.dialog uses a module listed above it, which is the healthy direction.
presentation.ui.component.dialog uses presentation.ui.screen.aiconfig, so a change to presentation.ui.screen.aiconfig can break presentation.ui.component.dialog, while a change to presentation.ui.component.dialog can't break presentation.ui.screen.aiconfig.
Position
Below the diagonal: presentation.ui.component.dialog uses a module listed above it, which is the healthy direction.
service uses presentation.ui.component.dialog, so a change to presentation.ui.component.dialog can break service, while a change to service can't break presentation.ui.component.dialog.
Position
Below the diagonal: service 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
A07:2025 — Authentication Failures
101
High / Critical
A05:2025 — Injection
13
High / Critical
A03:2025 — Software Supply Chain Failures
5
Medium
Roadmap
Top priorities: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href; Resolve the 90 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (90); Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
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 — 167
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 — 585
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 — 508
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 11
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 55 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 — 55 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, 1247 of 1260 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.kt) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.kt) and this repository declares a JVM test suite (repository root, Gradle), but it was not re-run: the analyzer environment could not run it. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 7 Maven/Gradle manifest(s) were read, stating a version for 55 dependency(ies) and leaving 9 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
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 (2 contributor(s) across 246 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 1 hold 0% 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.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: it declares a published package (presentation/build.gradle.kts), but no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `domain/src/main/kotlin/com/empathy/ai/domain/model/ContactProfile.kt`, `domain/src/main/kotlin/com/empathy/ai/domain/usecase/ManualSummaryUseCase.kt` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AC3 Page structure — 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. 1 further occurrence(s) are not listed individually; the score already reflects all 41.
AC6 Visual & motion safety — 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. 47 further occurrence(s) are not listed individually; the score already reflects all 87.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Boot via AndroidApp (app). the Android app did not build — `./gradlew :app:assembleDebug` exited 1: sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:187)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConn…; runtime evidence skipped (launch chosen because app/build.gradle.kts applies the Android application plugin and gradlew builds it).
C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
DM8 Value-object opportunities — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds primitive parameters that travel together through several signatures of the domain (a missing value object). Its deterministic rule has not yet shown 95 % precision on adjudicated rows, so the clumps it finds are counted here and not published as findings, and the card carries no score. That is a limit of the analyzer, not a finding about your code.
DM9 Scattered domain decisions — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
DM9 Scattered domain decisions — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Some of this repository's production types come from a frontend that does not bind comparison operands to the members they read, which arm one needs, and those types were not walked for this dimension. The counts above speak for the languages that declare it.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java was found, and this repository's Kotlin is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's Kotlin is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P1 CI/CD gates — 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. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X3 Exception handling — 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. 6 further occurrence(s) are not listed individually; the score already reflects all 46.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D13 REDACTED Scanning: REDACTED 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.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
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.
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.
19 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ContactDetailViewModel.onEvent at 56. A further 8 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being AiConfigViewModel.onEvent at 47 — they are counted neither in the figure above nor in this dimension's score. 8 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: presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt (AiConfigViewModel.onEvent at 47), presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/PastelTagsCard.kt (PastelTagsCardKt.getCategoryEmoji at 37), presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactListViewModel.kt (ContactListViewModel.onEvent at 31), presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt (UserProfileViewModel.onEvent at 30), presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt (SettingsViewModel.onEvent at 25), and 3 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.
+ 14 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with ContactDetailViewModel.onEvent (cyclomatic 56), ContactDetailTabViewModel.onEvent (cyclomatic 49). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 7.1 to about 7.8/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 29 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 5 bodies over 30 down to 30 or less in Cognitive Complexity — start with ContactDetailViewModel.onEvent (cognitive 55), ContactDetailTabViewModel.onEvent (cognitive 48), FloatingView.showInputDialog (cognitive 41). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 5 together lifts Cognitive Complexity from 6.6 to about 7.3/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.5 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 28 MethodTooLong finding(s) in God Classes — start with FloatingWindowService.kt (3), UserProfileScreen.kt (2), SettingsScreen.kt. — One of this dimension's main actionable groups (28 warning-level).
Resolve the 12 FileTooLong finding(s) in God Classes — start with FloatingWindowService.kt, FloatingView.kt, AiRepositoryImpl.kt. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 12 TooManyMethods finding(s) in God Classes — start with FloatingWindowService.kt, ContactDetailViewModel.kt, FloatingView.kt. — One of this dimension's main actionable groups (12 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.
196 duplicated block group(s) detected. 9.6 % of the production lines (10,501 of 108,925) are in a reported copy. A further 119 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 145 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 11 Duplicated block (18 lines × 2) finding(s) in Code Duplication — start with FloatingWindowService.kt (2), ContactRepositoryImpl.kt, ModernTimelineView.kt. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 10 Duplicated block (16 lines × 2) finding(s) in Code Duplication — start with ContactSelectScreen.kt (3), FloatingWindowService.kt (2), SessionHistoryScreen.kt. — One of this dimension's main actionable groups (10 warning-level).
Resolve the 9 Duplicated block (20 lines × 2) finding(s) in Code Duplication — start with IOSAlertDialog.kt (2), FloatingWindowService.kt, AiProviderRepositoryImpl.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 · Coupling8.4 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
5 production modules (Gradle), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 1 module(s) off the main sequence, with abstractness counted on 4 of the 5 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: :domain
What to do
Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 14 Low cohesion finding(s) in Cohesion (LCOM4) — start with IdentityPrefixIntegrationTest.kt, DateRangeTest.kt, FloatingWindowIntegrationTest.kt. — One of this dimension's main actionable groups (14 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 90 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (90). — One of this dimension's main actionable groups (90 issue-level).
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
1 of 24 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 7 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. 9 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 30 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.
Banned license: com.arthenica:ffmpeg-kit-full
What to do
Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.
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: presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt (14×49=686); presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt (9×56=504); data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt (23×17=391) Repeated repair below the complexity floor: data/src/main/kotlin/com/empathy/ai/data/local/FloatingWindowPreferences.kt (5 of 8 changes were fixes); app/src/main/java/com/empathy/ai/ui/ScreenshotPermissionActivity.kt (4 of 4 changes were fixes)
Resolve the 10 Hotspot finding(s) in Churn × Complexity Hotspots — start with ContactDetailTabViewModel.kt, ContactDetailViewModel.kt, AiRepositoryImpl.kt. — One of this dimension's main actionable groups (10 warning-level).
Resolve the 2 Repeated repair finding(s) in Churn × Complexity Hotspots — start with FloatingWindowPreferences.kt, ScreenshotPermissionActivity.kt. — One of this dimension's main actionable groups (2 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.
4 deducted task-comment markers across 108925 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 4 TodoComment finding(s) in Explicit Debt — start with ContactDetailTabViewModel.kt (2), PromptEditorScreen.kt, ContactDetailTabScreen.kt. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
2 of 2 documentation facets pass in full. 25 document(s) read across 5 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle.kts. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
6 naming inconsistencies among 93 declarations measured against a convention their peers follow.
`useNewUI` spells `UI` where 21 names in the project spell it `Ui`app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:125
`fetchAvailableModels should construct correct URL for OpenAI` spells `AI` where 18 names in the project spell it `Ai`app/src/test-disabled/java/com/empathy/ai/data/repository/AiProviderRepositoryFetchModelsTest.kt:77
`shouldStartAsBubble returns true when display mode is BUBBLE` spells `BUBBLE` where 25 names in the project spell it `Bubble`app/src/test-disabled/java/com/empathy/ai/domain/service/FloatingWindowServiceBubbleExpandTest.kt:76
`shouldStartAsBubble returns false when display mode is DIALOG` spells `DIALOG` where 23 names in the project spell it `Dialog`app/src/test-disabled/java/com/empathy/ai/domain/service/FloatingWindowServiceBubbleExpandTest.kt:89
`should mask text before calling AI` spells `AI` where 18 names in the project spell it `Ai`app/src/test-disabled/java/com/empathy/ai/domain/usecase/PolishDraftUseCaseTest.kt:196
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 `useNewUI` spells `UI` where 21 names in the project spell it `Ui` finding(s) in Naming Consistency — start with FloatingWindowService.kt. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `fetchAvailableModels should construct correct URL for OpenAI` spells… finding(s) in Naming Consistency — start with AiProviderRepositoryFetchModelsTest.kt. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `shouldStartAsBubble returns true when display mode is BUBBLE` spells… finding(s) in Naming Consistency — start with FloatingWindowServiceBubbleExpandTest.kt. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
3 of 6 build units (Gradle) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×3presentation/build.gradle.kts:1
What to do
Resolve the 3 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with build.gradle.kts (3). — One of this dimension's main actionable groups (3 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED 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.
10 finding(s): 0 critical, 10 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 10 REDACTED finding(s) in Secrets (history) — start with REDACTED (10). — One of this dimension's main actionable groups (10 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
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, 13 high, 0 medium, 0 low. 8 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 2 file(s) — `.github/labels.yml`, `gradlew` (line 74, line 180) — 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
What to do
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 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).
No action in Static Analysis (SAST) — all 8 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (8 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
449 of 449 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt. Counted over 449 of the 636 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Most significant orphaned file · ×3app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1
Dormant codebase
What to do
Resolve the 446 Orphaned file finding(s) in Knowledge Freshness — start with build.gradle.kts (3), AddTagDialog.kt (2), DebugLogger.kt (2). — One of this dimension's main actionable groups (446 recommendation-level).
Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with FloatingView.kt, FloatingWindowService.kt, ContactDetailTabViewModel.kt. — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 1 Dormant codebase finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — 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 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 5 platform declaration(s) and 55 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC2 · Forms & labels5.7 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×12) — 文档/开发文档/UI-原型/PRD19/empathy-prompt-editor-v2.html:71, 文档/开发文档/UI-原型/PRD20/联系人详情/新建联系人页.html:64, 文档/开发文档/UI-原型/PRD20/联系人详情/新建联系人页.html:72, …
This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×3) — 文档/开发文档/UI-原型/PRD20/联系人详情/新建联系人页.html:62, 文档/开发文档/UI-原型/PRD20/联系人详情/新建联系人页.html:70, 文档/开发文档/UI-原型/empathy-floating-window.html:81
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Do you agree with this assessment?
AC3 · Page structure5.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×13) — 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:2, 文档/开发文档/UI-原型/PRD19/empathy-prompt-editor-v2.html:2, 文档/开发文档/UI-原型/PRD19/empathy-settings-v3.html:2, …
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×19) — 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:2, 文档/开发文档/UI-原型/PRD19/empathy-prompt-editor-v2.html:2, 文档/开发文档/UI-原型/PRD19/empathy-settings-v3.html:2, …
A document must expose only one main landmark. Multiple visible <main> (or role="main") elements confuse the landmark map and the "skip to content" target. Keep one; remove or hide the rest. — 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:2
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×5) — 文档/开发文档/UI-原型/PRD21/AI配置-iOS风格.html:61, 文档/开发文档/UI-原型/PRD21/index.html:44, 文档/开发文档/UI-原型/PRD21/个人画像-iOS风格.html:87, …
user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta. (×2) — 文档/开发文档/UI-原型/PRD29/ai-advisor-home-ios.html:5, 文档/开发文档/UI-原型/PRD29/gemini对话界面.html:5
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
A script attaches a click listener to this <span>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. (×5) — 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:163, 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:164, 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:165, …
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. (×12) — 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:272, 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:323, 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:88, …
A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. (×6) — 文档/开发文档/UI-原型/废弃/contact-list-demo.html:371, 文档/开发文档/UI-原型/废弃/contact-list-demo.html:372, 文档/开发文档/UI-原型/废弃/contact-list-demo.html:373, …
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
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.
This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. (×28) — 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:34, 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:45, 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:64, …
<textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — 文档/开发文档/UI-原型/PRD19/empathy-prompt-editor-v2.html:71
`.animate-fade-in` moves (`animation: fadeIn 0.4s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:105, 文档/开发文档/UI-原型/PRD20/联系人详情/资料库页.html:28
`.filter-chip-active` sets color: white on background-color: #007AFF — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:78
<input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×4) — 文档/开发文档/UI-原型/PRD20/联系人详情/新建联系人页.html:64, 文档/开发文档/UI-原型/PRD20/联系人详情/新建联系人页.html:72, 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:78, …
`.segment-slider` moves (`transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:68
`.animate-fade-in` moves (`animation: fadeInUp 0.4s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:114
`.tag-yellow` sets color: #B8860B on background-color: #FFF8E1 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:86
`.tag-cyan` sets color: #00838F on background-color: #E0F7FA — 4.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:87
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
`PerformanceMonitor` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (isMonitoring, lastFrameTime, frameTimesMs, consecutiveSlowFrames, memorySnapshots; e.g. `isMonitoring` in `startMonitoring` at line 128). — app/src/main/java/com/empathy/ai/domain/util/PerformanceMonitor.kt:46
`SseStreamReader` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (consecutiveFailures; e.g. `consecutiveFailures` in `stream` at line 62). — data/src/main/kotlin/com/empathy/ai/data/remote/SseStreamReader.kt:42
`SystemPromptRepositoryImpl` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (cachedConfig; e.g. `cachedConfig` in `getConfig` at line 31). — data/src/main/kotlin/com/empathy/ai/data/repository/SystemPromptRepositoryImpl.kt:23
`BlockUpdateManager` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (lastBlockType; e.g. `lastBlockType` in `smartUpdate` at line 82). — data/src/main/kotlin/com/empathy/ai/data/util/BlockUpdateManager.kt:41
What to do
Java/Kotlin: keep container singletons stateless — move per-request data into locals or a request-scoped bean — or back the state with java.util.concurrent types (ConcurrentHashMap, AtomicInteger/AtomicReference), guard it with synchronized / a Lock (Kotlin: withLock), or mark a flag that is only ever overwritten volatile (@Volatile).
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.
`RepositoryModule` declares 17 abstract methods: `bindContactRepository`, `bindContactSortPreferencesRepository`, `bindContactSearchHistoryRepository`, `bindContactRecentHistoryRepository`, `bindBrainTagRepository`, `bindAiRepository`, `bindSettingsRepository`, `bindPrivacyRepository`, `bindAiProviderRepository`, `bindUserProfileRepository`, `bindFloatingWindowPreferencesRepository`, `bindAiSummaryResponseParser`, `bindCleanupPreferences`, `bindApiUsageRepository`, `bindAiAdvisorRepository`, `bindAiAdvisorPreferencesRepository`, `bindDeveloperModeRepository`. 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. — data/src/main/kotlin/com/empathy/ai/data/di/RepositoryModule.kt:52
`AiAdvisorDao` declares 21 abstract methods: `insertSession`, `getSessionsByContact`, `getActiveSession`, `getSessionById`, `updateSessionTitle`, `incrementMessageCount`, `deleteSession`, `deleteSessionsByContact`, `getLatestEmptySession`, `updateSessionPinned`, `insertConversation`, `getConversationsBySession`, `getConversationsBySessionFlow`, `getRecentConversations`, `getConversationsBySessionWithLimit`, `deleteConversation`, `clearSessionConversations`, `getConversationCount`, `updateSendStatus`, `updateContentAndStatus`, `updateAiMessageContentAndStatus`. 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. — data/src/main/kotlin/com/empathy/ai/data/local/dao/AiAdvisorDao.kt:31
`DailySummaryDao` declares 16 abstract methods: `insert`, `getSummariesByContact`, `getSummaryByDate`, `hasSummaryForDate`, `deleteByContactId`, `cleanupOldSummaries`, `getRecentSummaries`, `getSummariesInRange`, `getSummarizedDatesInRange`, `deleteSummariesInRange`, `getManualSummaries`, `countMissingDatesInRange`, `getSummariesByType`, `getById`, `updateContent`, `deleteById`. 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. — data/src/main/kotlin/com/empathy/ai/data/local/dao/DailySummaryDao.kt:22
`AiAdvisorRepository` declares 26 abstract methods: `createSession`, `getSessions`, `getActiveSession`, `getOrCreateActiveSession`, `getSessionById`, `updateSessionTitle`, `deleteSession`, `getLatestEmptySession`, `updateSessionPinned`, `deleteSessionsByContact`, `saveMessage`, `getConversations`, `getConversationsFlow`, `getRecentConversations`, `getConversationsBySessionWithLimit`, `deleteConversation`, `clearSession`, `getConversationCount`, `saveBlock`, `updateBlockContent`, `getBlocksByMessageId`, `observeBlocksByMessageId`, `updateMessageStatus`, `updateMessageContentAndStatus`, `updateAiMessageContentAndStatus`, `deleteMessage`. 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. — domain/src/main/kotlin/com/empathy/ai/domain/repository/AiAdvisorRepository.kt:27
`DailySummaryRepository` declares 16 abstract methods: `saveSummary`, `getSummariesByContact`, `getSummaryByDate`, `hasSummaryForDate`, `deleteByContactId`, `cleanupOldSummaries`, `getRecentSummaries`, `getSummariesInRange`, `getSummarizedDatesInRange`, `deleteSummariesInRange`, `getManualSummaries`, `countMissingDatesInRange`, `getSummariesByType`, `getById`, `updateContent`, `deleteSummary`. 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. — domain/src/main/kotlin/com/empathy/ai/domain/repository/DailySummaryRepository.kt:26
`FloatingWindowPreferencesRepository` declares 43 abstract methods: `saveState`, `loadState`, `saveEnabled`, `isEnabled`, `clear`, `saveButtonPosition`, `getButtonX`, `getButtonY`, `getButtonPosition`, `saveIndicatorPosition`, `getIndicatorPosition`, `saveRequestInfo`, `getRequestInfo`, `clearRequestInfo`, `saveSelectedTab`, `getSelectedTab`, `getSelectedTabAsActionType`, `saveLastContactId`, `getLastContactId`, `saveInputText`, `getInputText`, `saveUiState`, `restoreUiState`, `restoreUiStateAsObject`, `clearSavedUiState`, `hasSavedUiState`, `saveBubblePosition`, `getBubblePosition`, `saveBubbleState`, `getBubbleState`, `saveMinimizeState`, `getMinimizeStateIfValid`, `clearMinimizeState`, `hasValidMinimizeState`, `saveDisplayMode`, `getDisplayMode`, `shouldStartAsBubble`, `saveDisplayId`, `getDisplayId`, `saveContinuousScreenshotEnabled`, and 3 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. — domain/src/main/kotlin/com/empathy/ai/domain/repository/FloatingWindowPreferencesRepository.kt:24
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Other · Domain Modelling — Whether aggregates reference each other by identity (id) rather than by direct object reference — the core DDD consistency-boundary rule.
Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.
Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.
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.
`AiAdvisorConversationEntity`'s public constructor takes `id`, `contactId`, `sessionId`, `messageType`, … 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 `AiAdvisorConversationEntity` 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. — data/src/main/kotlin/com/empathy/ai/data/local/entity/AiAdvisorConversationEntity.kt:60
`AiAdvisorMessageBlockEntity`'s public constructor takes `id`, `messageId`, `type`, `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 `AiAdvisorMessageBlockEntity` 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. — data/src/main/kotlin/com/empathy/ai/data/local/entity/AiAdvisorMessageBlockEntity.kt:46
`AiAdvisorSessionEntity`'s public constructor takes `id`, `contactId`, `title` 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 `AiAdvisorSessionEntity` 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. — data/src/main/kotlin/com/empathy/ai/data/local/entity/AiAdvisorSessionEntity.kt:52
`AiProviderEntity`'s public constructor takes `id`, `name`, `baseUrl`, `apiKeyRef`, … 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 `AiProviderEntity` 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. — data/src/main/kotlin/com/empathy/ai/data/local/entity/AiProviderEntity.kt:44
`ApiUsageEntity`'s public constructor takes `id`, `providerId`, `providerName`, `modelId`, … 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 `ApiUsageEntity` 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. — data/src/main/kotlin/com/empathy/ai/data/local/entity/ApiUsageEntity.kt:51
`BrainTagEntity`'s public constructor takes `contactId`, `content`, `type`, `source` 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 `BrainTagEntity` 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. — data/src/main/kotlin/com/empathy/ai/data/local/entity/BrainTagEntity.kt:47
`ContactProfileEntity`'s public constructor takes `id`, `name`, `targetGoal`, `factsJson`, … 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 `ContactProfileEntity` 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. — data/src/main/kotlin/com/empathy/ai/data/local/entity/ContactProfileEntity.kt:31
`ConversationLogEntity`'s public constructor takes `contactId`, `userInput`, `aiResponse`, `originalUserInput` 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 `ConversationLogEntity` 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. — data/src/main/kotlin/com/empathy/ai/data/local/entity/ConversationLogEntity.kt:55
`ConversationTopicEntity`'s public constructor takes `id`, `contactId`, `content` 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 `ConversationTopicEntity` 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. — data/src/main/kotlin/com/empathy/ai/data/local/entity/ConversationTopicEntity.kt:56
`DailySummaryEntity`'s public constructor takes `contactId`, `summaryDate`, `content`, `keyEventsJson`, … 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 `DailySummaryEntity` 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. — data/src/main/kotlin/com/empathy/ai/data/local/entity/DailySummaryEntity.kt:57
`FailedSummaryTaskEntity`'s public constructor takes `contactId`, `summaryDate`, `failureReason` 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 `FailedSummaryTaskEntity` 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. — data/src/main/kotlin/com/empathy/ai/data/local/entity/FailedSummaryTaskEntity.kt:49
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 — 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 key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
`文档/项目文档/README.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `buildSrc`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — 文档/项目文档/README.md:37
`文档/开发文档/DR/DR-00032-TD00017任务清单文档审查报告.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `buildSrc`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — 文档/开发文档/DR/DR-00032-TD00017任务清单文档审查报告.md:164
`文档/开发文档/TDD/TDD-00001-悬浮窗架构设计.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `app`, `buildSrc`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — 文档/开发文档/TDD/TDD-00001-悬浮窗架构设计.md:44
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Update 文档/项目文档/README.md so it draws the parts the code has today: add buildSrc.
Update 文档/开发文档/DR/DR-00032-TD00017任务清单文档审查报告.md so it draws the parts the code has today: add buildSrc.
Update 文档/开发文档/TDD/TDD-00001-悬浮窗架构设计.md so it draws the parts the code has today: add app, buildSrc.
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.
文档/项目文档/README.md links to `../开发文档/STAT/STAT-00002-代码统计工具使用指南.md`, but `文档/开发文档/STAT/STAT-00002-代码统计工具使用指南.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — 文档/项目文档/README.md:133
文档/项目文档/README.md links to `../开发文档/STAT/STAT-00001-项目代码统计报告.md`, but `文档/开发文档/STAT/STAT-00001-项目代码统计报告.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — 文档/项目文档/README.md:134
文档/开发文档/MA/README.md links to `../../../skills/multi-agent-explorer/SKILL.md`, but `skills/multi-agent-explorer/SKILL.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — 文档/开发文档/MA/README.md:51
文档/开发文档/MA/README.md links to `../../../skills/multi-agent-explorer/references/report-templates.md`, but `skills/multi-agent-explorer/references/report-templates.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — 文档/开发文档/MA/README.md:52
文档/开发文档/MA/README.md links to `../../../skills/multi-agent-explorer/references/worktree-guide.md`, but `skills/multi-agent-explorer/references/worktree-guide.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — 文档/开发文档/MA/README.md:53
文档/开发文档/MA/MA/README.md links to `../../../skills/multi-agent-explorer/SKILL.md`, but `文档/skills/multi-agent-explorer/SKILL.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — 文档/开发文档/MA/MA/README.md:51
文档/开发文档/MA/MA/README.md links to `../../../skills/multi-agent-explorer/references/report-templates.md`, but `文档/skills/multi-agent-explorer/references/report-templates.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — 文档/开发文档/MA/MA/README.md:52
文档/开发文档/MA/MA/README.md links to `../../../skills/multi-agent-explorer/references/worktree-guide.md`, but `文档/skills/multi-agent-explorer/references/worktree-guide.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — 文档/开发文档/MA/MA/README.md:53
app/src/test/java/com/empathy/ai/data/repository/README.md links to `../../../docs/05-FixBug/AI响应解析正则表达式错误详细分析报告.md`, but `app/src/test/java/com/empathy/docs/05-FixBug/AI响应解析正则表达式错误详细分析报告.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — app/src/test/java/com/empathy/ai/data/repository/README.md:175
app/src/test/java/com/empathy/ai/data/repository/README.md links to `../../../docs/05-FixBug/AI响应解析Bug修复设计方案.md`, but `app/src/test/java/com/empathy/docs/05-FixBug/AI响应解析Bug修复设计方案.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — app/src/test/java/com/empathy/ai/data/repository/README.md:176
app/src/test/java/com/empathy/ai/data/repository/README.md links to `../../../docs/05-FixBug/正则表达式Bug修复报告.md`, but `app/src/test/java/com/empathy/docs/05-FixBug/正则表达式Bug修复报告.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — app/src/test/java/com/empathy/ai/data/repository/README.md:177
What to do
Reconcile the README with reality: 文档/项目文档/README.md links to `../开发文档/STAT/STAT-00002-代码统计工具使用指南.md`, but `文档/开发文档/STAT/STAT-00002-代码统计工具使用指南.md` does not exist; 文档/项目文档/README.md links to `../开发文档/STAT/STAT-00001-项目代码统计报告.md`, but `文档/开发文档/STAT/STAT-00001-项目代码统计报告.md` does not exist; 文档/开发文档/MA/README.md links to `../../../skills/multi-agent-explorer/SKILL.md`, but `skills/multi-agent-explorer/SKILL.md` does not exist; 文档/开发文档/MA/README.md links to `../../../skills/multi-agent-explorer/references/report-templates.md`, but `skills/multi-agent-explorer/references/report-templates.md` does not exist; 文档/开发文档/MA/README.md links to `../../../skills/multi-agent-explorer/references/worktree-guide.md`, but `skills/multi-agent-explorer/references/worktree-guide.md` does not exist.
Do you agree with this assessment?
P1 · CI/CD gates8.5 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
What to do
Run the test suite in CI via an explicit runner step (`./gradlew test` for the toolchain this pipeline already uses) and gate merges on it.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
What to do
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
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 · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Other · Security — Only what this repository's own non-C# files could be read for was assessed — markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
`https://cdn.tailwindcss.com` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 21 such include(s) across the repository's markup. — 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:7
What to do
Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
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.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
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/3 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.
`testConnection` 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`. — data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:176
`fetchAvailableModels` 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`. — data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:284
`testProxyConnection` 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`. — data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:528
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.
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.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch (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. (×34) — presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:1109, presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/PromptEditorViewModel.kt:444, presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/MissingSummaryCard.kt:136, …
`catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×5) — data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:437, data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:514, data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:563, …
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. — data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1008
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 12 of 55 WCAG 2.2 Level A/AA success criteria (22%; ≈24% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 43 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 8 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 70 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
AX1 Captive dependencies — Not applicable: Dagger rejects, at compile time, a component that holds a binding with a narrower scope than its own.
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the Android app did not build — `./gradlew :app:assembleDebug` exited 1: sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:187)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConn…; runtime evidence skipped (launch chosen because app/build.gradle.kts applies the Android application plugin and gradlew builds it) This is a statement about this run, not a statement about your application: nothing here says the app is inaccessible, only that it was never run.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no data at rest for these controls to protect.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named column (email, first_name, date_of_birth, phone_number, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — ~71062 lines of test source are present (.kt) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .kt suite was found but not re-run
D12 Dependency Hygiene — Not scored — 7 Maven/Gradle manifest(s) were read, stating a version for 55 dependency(ies) and leaving 9 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
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.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .kt, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — navigability not assessed
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) and a Gradle version catalogue — not scanned yet).
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 2 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) and a Gradle version catalogue — not scanned yet).
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM10 One transaction, one aggregate — no repository writes detected — no operation to judge against the one-aggregate rule
DM2 Strongly-typed ids — no id-bearing domain types detected — strongly-typed-id adoption not assessable
DM3 Integration-event coupling — no integration events detected — coupling check not applicable
DM4 Rich vs anemic model — no data-bearing entities detected — rich-vs-anemic model not assessable
DM5 Encapsulated state — no domain entities found — DM5 grades how entities protect their state, and this repository declares none
DM7 Repository granularity — no repository abstraction detected (e.g. uses a document session)
DM8 Value-object opportunities — not scored — the deterministic rule found 3 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 source (5 module(s), 627 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service — it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@Benchmark` in a Java, Kotlin or Scala file importing JMH or kotlinx-benchmark, Jetpack Benchmark's `measureRepeated` in a file importing androidx.benchmark, or JMH/kotlinx-benchmark/androidx.benchmark in a pom.xml, Gradle or sbt build, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Kotlin was read, and it logs through none that an assembled message defeats: Android's `Log` and Timber, java.util.logging and log4j-api-kotlin take one finished message (as log4net does in C#), or it makes no call through a named logger at all. Calls made through SLF4J, log4j 2 or kotlin-logging (`LoggerFactory.getLogger`, `KotlinLogging.logger {}`) would be judged.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×18
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:272— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:323— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:88— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:124— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:152— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:180— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:226— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/PRD21/个人画像-iOS风格.html:81— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/PRD21/个人画像-iOS风格.html:133— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/PRD21/个人画像-iOS风格.html:178— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/PRD21/个人画像-iOS风格.html:225— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/PRD21/个人画像-iOS风格.html:264— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/废弃/contact-list-demo.html:371— A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/废弃/contact-list-demo.html:372— A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/废弃/contact-list-demo.html:373— A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/废弃/contact-list-demo.html:374— A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/废弃/contact-list-demo.html:375— A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> 文档/开发文档/UI-原型/废弃/contact-list-demo.html:376— A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
<html> without a lang 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang 文档/开发文档/UI-原型/PRD19/empathy-prompt-editor-v2.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang 文档/开发文档/UI-原型/PRD19/empathy-settings-v3.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang 文档/开发文档/UI-原型/PRD19/联系人列表界面-纯白风格.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang 文档/开发文档/UI-原型/PRD21/AI配置-iOS风格.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang 文档/开发文档/UI-原型/PRD21/个人画像-iOS风格.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang 文档/开发文档/UI-原型/PRD21/添加服务商-iOS风格.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang 文档/开发文档/UI-原型/empathy-floating-window.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang 文档/开发文档/UI-原型/废弃/empathy-contact-list-v2.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang 文档/开发文档/UI-原型/废弃/empathy-contact-list-v3.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang 文档/开发文档/UI-原型/废弃/empathy-contact-list.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang 文档/开发文档/UI-原型/废弃/empathy-settings.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang 文档/开发文档/UI-原型/废弃/联系人界面.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC2 · Forms & labels· <input> without a programmatic label · ×10
<input> without a programmatic label 文档/开发文档/UI-原型/PRD20/联系人详情/新建联系人页.html:64— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label 文档/开发文档/UI-原型/PRD20/联系人详情/新建联系人页.html:72— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:78— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label 文档/开发文档/UI-原型/PRD21/AI配置-iOS风格.html:50— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label 文档/开发文档/UI-原型/PRD21/添加服务商-iOS风格.html:42— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label 文档/开发文档/UI-原型/PRD21/添加服务商-iOS风格.html:49— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label 文档/开发文档/UI-原型/PRD21/添加服务商-iOS风格.html:56— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label 文档/开发文档/UI-原型/PRD29/ai-advisor-home-ios.html:63— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label 文档/开发文档/UI-原型/PRD29/gemini对话界面.html:90— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label 文档/开发文档/UI-原型/废弃/empathy-settings.html:34— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC4 · Keyboard semantics· Click handler on a non-interactive <span> · ×5
Click handler on a non-interactive <span> 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:163— A script attaches a click listener to this <span>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <span> 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:164— A script attaches a click listener to this <span>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <span> 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:165— A script attaches a click listener to this <span>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <span> 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:166— A script attaches a click listener to this <span>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <span> 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:167— A script attaches a click listener to this <span>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
AC2 · Forms & labels· <label> that labels no control · ×3
<label> that labels no control 文档/开发文档/UI-原型/PRD20/联系人详情/新建联系人页.html:62— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control 文档/开发文档/UI-原型/PRD20/联系人详情/新建联系人页.html:70— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control 文档/开发文档/UI-原型/empathy-floating-window.html:81— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels· <textarea> without a programmatic label · ×2
<textarea> without a programmatic label 文档/开发文档/UI-原型/PRD19/empathy-prompt-editor-v2.html:71— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<textarea> without a programmatic label 文档/开发文档/UI-原型/empathy-floating-window.html:94— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
Viewport restricts zoom 文档/开发文档/UI-原型/PRD29/ai-advisor-home-ios.html:5— user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
Viewport restricts zoom 文档/开发文档/UI-原型/PRD29/gemini对话界面.html:5— user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
Banned license: com.arthenica:ffmpeg-kit-full — `com.arthenica:ffmpeg-kit-full` 6.0.LTS is published on Maven Central under `LGPL-3.0`, which this policy bans, and this repository declares it in a Maven or Gradle manifest. The licence was read from the artifact's POM `<licenses>` block — following `<parent>` where the POM inherits them — and normalised to SPDX before it was judged, because Maven publishes the name as free text (`GNU Affero General Public License v3` is AGPL-3.0). Where a POM lists several licences they are read as a CHOICE, per Maven's own documentation, so this is charged only because EVERY listed licence is banned. Replace the dependency, or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Swallowed exception (caught, then discarded) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:1109— `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) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/PromptEditorViewModel.kt:444— `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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/MissingSummaryCard.kt:136— `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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/contact/AvatarPicker.kt:315— `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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/AiSummaryCard.kt:141— `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) domain/src/main/kotlin/com/empathy/ai/domain/util/DataCleanupManager.kt:171— `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) domain/src/main/kotlin/com/empathy/ai/domain/util/DateUtils.kt:87— `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) domain/src/main/kotlin/com/empathy/ai/domain/util/DateUtils.kt:101— `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) data/src/main/kotlin/com/empathy/ai/data/util/ApiErrorHandler.kt:164— `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) data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:373— `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) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:437— `catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:514— `catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:563— `catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:631— `catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1030— `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) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1080— `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) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1500— `catch (ex: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) data/src/main/kotlin/com/empathy/ai/data/repository/DailySummaryRepositoryImpl.kt:278— `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) data/src/main/kotlin/com/empathy/ai/data/repository/DailySummaryRepositoryImpl.kt:283— `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) data/src/main/kotlin/com/empathy/ai/data/repository/UserProfileRepositoryImpl.kt:129— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) data/src/main/kotlin/com/empathy/ai/data/parser/EnhancedJsonCleaner.kt:97— `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) data/src/main/kotlin/com/empathy/ai/data/local/PromptFileStorage.kt:245— `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) data/src/main/kotlin/com/empathy/ai/data/local/PromptFileStorage.kt:273— `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) data/src/main/kotlin/com/empathy/ai/data/local/UserProfileBackupManager.kt:92— `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) data/src/main/kotlin/com/empathy/ai/data/local/UserProfileBackupManager.kt:105— `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.
MethodTooLong: SettingsScreenKt.SettingsScreenContent presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SettingsScreen.kt:275— MethodTooLong — SettingsScreenContent runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EditFactDialogKt.EditFactDialog presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:71— MethodTooLong — EditFactDialog runs 204 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 104 over it, 2.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: FloatingView.showInputDialog app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:440— MethodTooLong — showInputDialog runs 192 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 92 over it, 1.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: SystemPromptEditScreenKt.SystemPromptEditContent presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SystemPromptEditScreen.kt:68— MethodTooLong — SystemPromptEditContent runs 159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 59 over it, 1.59× 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: IOSProviderCardKt.IOSProviderCard presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:87— MethodTooLong — IOSProviderCard runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× 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: EditConversationDialogKt.EditConversationDialog presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditConversationDialog.kt:61— MethodTooLong — EditConversationDialog runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× 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: EditSummaryDialogKt.EditSummaryDialog presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt:60— MethodTooLong — EditSummaryDialog runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× 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: EditProviderScreenKt.EditProviderScreenContent presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/EditProviderScreen.kt:128— MethodTooLong — EditProviderScreenContent runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× 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: UserProfileScreenKt.UserProfileScreenContent presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:82— MethodTooLong — UserProfileScreenContent runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× 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: AiRepositoryImpl.analyzeChat data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:306— MethodTooLong — analyzeChat runs 125 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× 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: ProviderCardKt.ProviderCard presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ProviderCard.kt:58— MethodTooLong — ProviderCard runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× 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: AiAdvisorChatScreenKt.ChatBubble presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:534— MethodTooLong — ChatBubble runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× 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: AddProviderScreenKt.AddProviderScreenContent presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AddProviderScreen.kt:113— MethodTooLong — AddProviderScreenContent runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× 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: AvatarPickerKt.AvatarPicker presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/contact/AvatarPicker.kt:76— MethodTooLong — AvatarPicker runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× 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: PersonaTabKt.PersonaTab presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/persona/PersonaTab.kt:102— MethodTooLong — PersonaTab runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FloatingWindowService.performAnalyze app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:802— MethodTooLong — performAnalyze runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ContactDetailViewModel.onEvent presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:95— MethodTooLong — onEvent runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TagConfirmationDialogKt.TagConfirmationDialog presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/TagConfirmationDialog.kt:63— MethodTooLong — TagConfirmationDialog runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FloatingWindowService.minimizeDialog app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1255— MethodTooLong — minimizeDialog runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EditContactInfoDialogKt.EditContactInfoDialog presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:378— MethodTooLong — EditContactInfoDialog runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TimeoutInputKt.TimeoutInput presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:68— MethodTooLong — TimeoutInput runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ProxySettingsDialogKt.ProxySettingsContent presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/ProxySettingsDialog.kt:92— MethodTooLong — ProxySettingsContent runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FloatingWindowService.performCheck app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1055— MethodTooLong — performCheck runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SessionHistoryScreenKt.SessionListItem presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:261— MethodTooLong — SessionListItem runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FloatingViewV2.initViews presentation/src/main/kotlin/com/empathy/ai/presentation/ui/floating/FloatingViewV2.kt:101— MethodTooLong — initViews runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
+ 3 more in this group — see findings.md.
AC3 · Page structure· Page without a main landmark · ×19
Page without a main landmark 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:2— 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 文档/开发文档/UI-原型/PRD19/empathy-prompt-editor-v2.html:2— 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 文档/开发文档/UI-原型/PRD19/empathy-settings-v3.html:2— 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 文档/开发文档/UI-原型/PRD19/联系人列表界面-纯白风格.html:2— 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 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:2— 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 文档/开发文档/UI-原型/PRD20/联系人详情/资料库页.html:2— 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 文档/开发文档/UI-原型/PRD21/index.html:2— 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 文档/开发文档/UI-原型/PRD21/个人画像-iOS风格.html:2— 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 文档/开发文档/UI-原型/PRD29/ai-advisor-home-ios.html:2— 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 文档/开发文档/UI-原型/empathy-floating-window.html:2— 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 文档/开发文档/UI-原型/废弃/actual-ui-analysis.html:2— 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 文档/开发文档/UI-原型/废弃/contact-list-demo.html:2— 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 文档/开发文档/UI-原型/废弃/empathy-contact-list-v2.html:2— 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 文档/开发文档/UI-原型/废弃/empathy-contact-list-v3.html:2— 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 文档/开发文档/UI-原型/废弃/empathy-contact-list.html:2— 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 文档/开发文档/UI-原型/废弃/empathy-settings.html:2— 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 文档/开发文档/UI-原型/废弃/simplified-settings.html:2— 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 文档/开发文档/UI-原型/废弃/spacing-demo.html:2— 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 文档/开发文档/UI-原型/废弃/warm-gold-theme.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Low cohesion: IdentityPrefixIntegrationTest (LCOM4 15) app/src/test-disabled/java/com/empathy/ai/integration/IdentityPrefixIntegrationTest.kt:27— IdentityPrefixIntegrationTest's methods fall into 15 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 15 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: DateRangeTest (LCOM4 11) app/src/test-disabled/java/com/empathy/ai/domain/model/DateRangeTest.kt:11— DateRangeTest'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: FloatingWindowIntegrationTest (LCOM4 9) app/src/androidTest-disabled/java/com/empathy/ai/presentation/ui/floating/FloatingWindowIntegrationTest.kt:31— FloatingWindowIntegrationTest's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: FloatingBubbleViewDuplicateTest (LCOM4 9) app/src/test-disabled/java/com/empathy/ai/presentation/ui/floating/FloatingBubbleViewDuplicateTest.kt:26— FloatingBubbleViewDuplicateTest's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: FloatingWindowManagerTest (LCOM4 7) app/src/androidTest-disabled/java/com/empathy/ai/domain/util/FloatingWindowManagerTest.kt:24— FloatingWindowManagerTest's methods fall into 7 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 7 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: FloatingWindowServiceBubbleExpandTest (LCOM4 7) app/src/test-disabled/java/com/empathy/ai/domain/service/FloatingWindowServiceBubbleExpandTest.kt:28— FloatingWindowServiceBubbleExpandTest's methods fall into 7 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 7 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: PerformanceMonitorTest (LCOM4 6) app/src/test-disabled/java/com/empathy/ai/domain/util/PerformanceMonitorTest.kt:20— PerformanceMonitorTest's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: PromptEditorViewModelTest (LCOM4 6) app/src/test-disabled/java/com/empathy/ai/presentation/viewmodel/PromptEditorViewModelTest.kt:51— PromptEditorViewModelTest's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MinimizedRequestInfoTest (LCOM4 5) app/src/test-disabled/java/com/empathy/ai/domain/model/MinimizedRequestInfoTest.kt:12— MinimizedRequestInfoTest's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DateRangePickerDialogTest (LCOM4 5) app/src/test-disabled/java/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialogTest.kt:15— DateRangePickerDialogTest's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: SettingsViewModelFloatingWindowTest (LCOM4 5) app/src/test-disabled/java/com/empathy/ai/presentation/viewmodel/SettingsViewModelFloatingWindowTest.kt:49— SettingsViewModelFloatingWindowTest's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: FloatingWindowServiceBubbleDuplicateTest (LCOM4 4) app/src/test-disabled/java/com/empathy/ai/domain/service/FloatingWindowServiceBubbleDuplicateTest.kt:28— FloatingWindowServiceBubbleDuplicateTest's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DataCleanupManagerTest (LCOM4 4) app/src/test-disabled/java/com/empathy/ai/domain/util/DataCleanupManagerTest.kt:23— DataCleanupManagerTest's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: UserProfilePerformanceTest (LCOM4 4) app/src/test-disabled/java/com/empathy/ai/performance/UserProfilePerformanceTest.kt:17— UserProfilePerformanceTest'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.
FileTooLong: service/FloatingWindowService.kt app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt— FileTooLong — 2183 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: FloatingWindowService (78-4082). The bar is 500 significant lines; this is 1683 over it, 4.37× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: util/FloatingView.kt app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt— FileTooLong — 1787 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: FloatingView (44-3215). The bar is 500 significant lines; this is 1287 over it, 3.57× 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: repository/AiRepositoryImpl.kt data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt— FileTooLong — 1056 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: AiRepositoryImpl (86-1604). The bar is 500 significant lines; this is 556 over it, 2.11× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: viewmodel/ContactDetailTabViewModel.kt presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt— FileTooLong — 959 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: ContactDetailTabViewModel (85-1748). The bar is 500 significant lines; this is 459 over it, 1.92× 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: viewmodel/ContactDetailViewModel.kt presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt— FileTooLong — 742 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: ContactDetailViewModel (71-1257). The bar is 500 significant lines; this is 242 over it, 1.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: contact/ContactListScreen.kt presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt— FileTooLong — 712 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 212 over it, 1.42× 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: userprofile/UserProfileScreen.kt presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt— FileTooLong — 710 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 210 over it, 1.42× 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: advisor/AiAdvisorChatScreen.kt presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt— FileTooLong — 662 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 162 over it, 1.32× 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: viewmodel/AiAdvisorChatViewModel.kt presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt— FileTooLong — 661 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: AiAdvisorChatViewModel (73-1265). The bar is 500 significant lines; this is 161 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: contact/ContactDetailTabScreen.kt presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailTabScreen.kt— FileTooLong — 631 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 131 over it, 1.26× 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: viewmodel/AiConfigViewModel.kt presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt— FileTooLong — 555 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: AiConfigViewModel (38-1087). The bar is 500 significant lines; this is 55 over it, 1.11× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: persona/ModernPersonaTab.kt presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt— FileTooLong — 508 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 8 over it, 1.02× 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.
TooManyMethods: FloatingWindowService app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:78— TooManyMethods — 87 methods. The bar is 30 methods; this is 57 over it, 2.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ContactDetailViewModel presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:71— TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.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: FloatingView app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:44— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ContactDetailTabViewModel presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:85— TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× 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: AiConfigViewModel presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt:38— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FloatingWindowPreferences data/src/main/kotlin/com/empathy/ai/data/local/FloatingWindowPreferences.kt:26— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. Most of these members implement repository.FloatingWindowPreferencesRepository (43 of 49 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: AiRepositoryImpl data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:86— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ContactListViewModel presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactListViewModel.kt:61— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AiAdvisorChatViewModel presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:73— 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: FloatingViewV2 presentation/src/main/kotlin/com/empathy/ai/presentation/ui/floating/FloatingViewV2.kt:42— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: UserProfileViewModel presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:64— 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: SettingsViewModel presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:64— 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.
Duplicated block (18 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:803— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:803-820 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1056-1073 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:803` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:907— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:907-924 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1154-1171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:907` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:903` calls `cleanupCompletedIndicator` and `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1150` 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 (18 lines × 2) data/src/main/kotlin/com/empathy/ai/data/repository/ContactRepositoryImpl.kt:276— data/src/main/kotlin/com/empathy/ai/data/repository/ContactRepositoryImpl.kt:276-293 | data/src/main/kotlin/com/empathy/ai/data/repository/ContactRepositoryImpl.kt:301-318 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/ContactRepositoryImpl.kt:276` 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 (18 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernTimelineView.kt:145— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernTimelineView.kt:145-162 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/timeline/EmotionTimelineView.kt:83-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernTimelineView.kt:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:413— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:413-430 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:423-440 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:413` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1011— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1011-1028 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1075-1092 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1011` 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 (18 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:236— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:236-253 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:260-277 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:236` 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 (18 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:368— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:368-385 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModelWithDebug.kt:227-244 — 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 (18 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:376— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:376-393 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/CreateContactViewModel.kt:77-94 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:376` 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 (18 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:454— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:454-471 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:563-580 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:454` 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 (18 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:111— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:111-128 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.kt:147-164 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
DM11 · Constructible invalid state· Constructible in an invalid state · ×11
Constructible in an invalid state: AiAdvisorConversationEntity data/src/main/kotlin/com/empathy/ai/data/local/entity/AiAdvisorConversationEntity.kt:60— `AiAdvisorConversationEntity`'s public constructor takes `id`, `contactId`, `sessionId`, `messageType`, … 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 `AiAdvisorConversationEntity` 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: AiAdvisorMessageBlockEntity data/src/main/kotlin/com/empathy/ai/data/local/entity/AiAdvisorMessageBlockEntity.kt:46— `AiAdvisorMessageBlockEntity`'s public constructor takes `id`, `messageId`, `type`, `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 `AiAdvisorMessageBlockEntity` 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: AiAdvisorSessionEntity data/src/main/kotlin/com/empathy/ai/data/local/entity/AiAdvisorSessionEntity.kt:52— `AiAdvisorSessionEntity`'s public constructor takes `id`, `contactId`, `title` 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 `AiAdvisorSessionEntity` 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: AiProviderEntity data/src/main/kotlin/com/empathy/ai/data/local/entity/AiProviderEntity.kt:44— `AiProviderEntity`'s public constructor takes `id`, `name`, `baseUrl`, `apiKeyRef`, … 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 `AiProviderEntity` 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: ApiUsageEntity data/src/main/kotlin/com/empathy/ai/data/local/entity/ApiUsageEntity.kt:51— `ApiUsageEntity`'s public constructor takes `id`, `providerId`, `providerName`, `modelId`, … 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 `ApiUsageEntity` 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: BrainTagEntity data/src/main/kotlin/com/empathy/ai/data/local/entity/BrainTagEntity.kt:47— `BrainTagEntity`'s public constructor takes `contactId`, `content`, `type`, `source` 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 `BrainTagEntity` 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: ContactProfileEntity data/src/main/kotlin/com/empathy/ai/data/local/entity/ContactProfileEntity.kt:31— `ContactProfileEntity`'s public constructor takes `id`, `name`, `targetGoal`, `factsJson`, … 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 `ContactProfileEntity` 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: ConversationLogEntity data/src/main/kotlin/com/empathy/ai/data/local/entity/ConversationLogEntity.kt:55— `ConversationLogEntity`'s public constructor takes `contactId`, `userInput`, `aiResponse`, `originalUserInput` 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 `ConversationLogEntity` 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: ConversationTopicEntity data/src/main/kotlin/com/empathy/ai/data/local/entity/ConversationTopicEntity.kt:56— `ConversationTopicEntity`'s public constructor takes `id`, `contactId`, `content` 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 `ConversationTopicEntity` 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: DailySummaryEntity data/src/main/kotlin/com/empathy/ai/data/local/entity/DailySummaryEntity.kt:57— `DailySummaryEntity`'s public constructor takes `contactId`, `summaryDate`, `content`, `keyEventsJson`, … 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 `DailySummaryEntity` 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: FailedSummaryTaskEntity data/src/main/kotlin/com/empathy/ai/data/local/entity/FailedSummaryTaskEntity.kt:49— `FailedSummaryTaskEntity`'s public constructor takes `contactId`, `summaryDate`, `failureReason` 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 `FailedSummaryTaskEntity` 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.
Hotspot: presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:129— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in ContactDetailTabViewModel.onEvent at line 129. 2 of those changes were fix/bug commits, and the other 12 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 2025-10-26..2026-01-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-10-26 08:01:47 +00:00' --until='2026-01-24 08:01:47 +00:00' --full-history --no-merges -- presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.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: presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:95— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in ContactDetailViewModel.onEvent at line 95. 1 of those changes was a fix/bug commit, and the other 8 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 2025-10-26..2026-01-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-10-26 08:01:47 +00:00' --until='2026-01-24 08:01:47 +00:00' --full-history --no-merges -- presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.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: data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:306— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in AiRepositoryImpl.analyzeChat at line 306. 1 of those changes was a fix/bug commit, and the other 22 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 2025-10-26..2026-01-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-10-26 08:01:47 +00:00' --until='2026-01-24 08:01:47 +00:00' --full-history --no-merges -- data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.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: presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:534— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in AiAdvisorChatScreenKt.ChatBubble at line 534. 6 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2025-10-26..2026-01-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-10-26 08:01:47 +00:00' --until='2026-01-24 08:01:47 +00:00' --full-history --no-merges -- presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.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: presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.kt presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.kt:90— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.kt changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in ContactDetailScreenKt.ContactDetailScreenContent at line 90. 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 2025-10-26..2026-01-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-10-26 08:01:47 +00:00' --until='2026-01-24 08:01:47 +00:00' --full-history --no-merges -- presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.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: presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:82— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in UserProfileScreenKt.UserProfileScreenContent at line 82. 3 of those changes were fix/bug commits, and the other 4 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 2025-10-26..2026-01-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-10-26 08:01:47 +00:00' --until='2026-01-24 08:01:47 +00:00' --full-history --no-merges -- presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.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/java/com/empathy/ai/domain/util/FloatingView.kt app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:440— app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in FloatingView.showInputDialog at line 440. 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 2025-10-26..2026-01-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-10-26 08:01:47 +00:00' --until='2026-01-24 08:01:47 +00:00' --full-history --no-merges -- app/src/main/java/com/empathy/ai/domain/util/FloatingView.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: presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:78— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in FactStreamTabKt.FactStreamTab at line 78. 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 2025-10-26..2026-01-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-10-26 08:01:47 +00:00' --until='2026-01-24 08:01:47 +00:00' --full-history --no-merges -- presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.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: presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:65— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in ProviderFormDialogKt.ProviderFormDialog at line 65. 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 2025-10-26..2026-01-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-10-26 08:01:47 +00:00' --until='2026-01-24 08:01:47 +00:00' --full-history --no-merges -- presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.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: presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/vault/DataVaultTab.kt presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/vault/DataVaultTab.kt:72— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/vault/DataVaultTab.kt changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in DataVaultTabKt.DataVaultTab at line 72. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2025-10-26..2026-01-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-10-26 08:01:47 +00:00' --until='2026-01-24 08:01:47 +00:00' --full-history --no-merges -- presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/vault/DataVaultTab.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.
Duplicated block (16 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:757— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:757-772 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1010-1025 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:757` 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 (16 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:875— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:875-890 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1125-1140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:875` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:162— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:162-177 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:181-196 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:162` 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 (16 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:501— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:501-516 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:490-505 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:501` 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, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:506` calls `SimpleDateFormat`, `getDefault` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:518` 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 (16 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:518— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:518-533 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:508-523 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:518` 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, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:506` calls `SimpleDateFormat`, `getDefault` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:516` 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 (16 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:283— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:283-298 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:431-446 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:283` 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 (16 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:305— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:305-320 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:334-349 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:305` 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, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:323` calls `Spacer`, `height` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:350` 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 (16 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/BrainTagViewModel.kt:180— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/BrainTagViewModel.kt:180-195 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:666-681 — 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 (16 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:542— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:542-557 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:729-744 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:542` 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 (16 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:347— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:347-362 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:482-497 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:347` 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 (20 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2146— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2146-2165 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3357-3376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2146` 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/java/com/empathy/ai/service/FloatingWindowService.kt:3377` calls `handleKnowledgeV2` and `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2166` 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 (20 lines × 2) data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:187— data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:187-206 | data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:289-308 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:187` 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 (20 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:274— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:274-293 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt:186-205 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:83— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:83-102 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/TagConfirmationDialog.kt:93-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:83` 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 (20 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:146— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:146-165 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:784-803 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/TagConfirmationDialog.kt:189— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/TagConfirmationDialog.kt:189-208 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:783-802 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/TagConfirmationDialog.kt:189` 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 (20 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.kt:238— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.kt:238-257 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailTabScreen.kt:445-464 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.kt:238` 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 (20 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailTabScreen.kt:538— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailTabScreen.kt:538-557 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailTabScreen.kt:661-680 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailTabScreen.kt:538` 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 (20 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:197— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:197-216 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/QuickDateOptions.kt:84-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1550— app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1550-1560 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1614-1624 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1550` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:822— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:822-832 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1075-1085 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:822` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) domain/src/main/kotlin/com/empathy/ai/domain/usecase/GenerateReplyUseCase.kt:74— domain/src/main/kotlin/com/empathy/ai/domain/usecase/GenerateReplyUseCase.kt:74-84 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/PolishDraftUseCase.kt:73-83 — before extracting anything, compare `domain/src/main/kotlin/com/empathy/ai/domain/usecase/GenerateReplyUseCase.kt` and `domain/src/main/kotlin/com/empathy/ai/domain/usecase/PolishDraftUseCase.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `domain/src/main/kotlin/com/empathy/ai/domain/usecase/GenerateReplyUseCase.kt:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/AddContactDialog.kt:58— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/AddContactDialog.kt:58-68 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:151-161 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/AddContactDialog.kt:58` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:371— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:371-381 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/ListView.kt:143-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. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:371` 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 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:638— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:638-648 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:654-664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:638` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:845— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:845-855 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:879-889 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:845` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) data/src/main/kotlin/com/empathy/ai/data/local/ContactRecentHistoryPreferences.kt:57— data/src/main/kotlin/com/empathy/ai/data/local/ContactRecentHistoryPreferences.kt:57-67 | data/src/main/kotlin/com/empathy/ai/data/local/ContactSearchHistoryPreferences.kt:57-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:157— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:157-168 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:233-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:157` 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 (10 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:778— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:778-787 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1031-1040 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:778` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2596— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2596-2605 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ImagePreviewView.kt:126-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2596` 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) domain/src/main/kotlin/com/empathy/ai/domain/usecase/CheckDraftUseCase.kt:120— domain/src/main/kotlin/com/empathy/ai/domain/usecase/CheckDraftUseCase.kt:120-129 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/FeedTextUseCase.kt:36-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:131— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:131-140 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:200-209 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:131` 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 (10 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/BrainTagViewModel.kt:132— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/BrainTagViewModel.kt:132-141 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactListViewModel.kt:245-254 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/BrainTagViewModel.kt:126` calls `refreshTags`, `loadTags` and `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactListViewModel.kt:240` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) app/src/test-disabled/java/com/empathy/ai/testutil/TestDataFactory.kt:59— app/src/test-disabled/java/com/empathy/ai/testutil/TestDataFactory.kt:59-68 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/timeline/TimelineItem.kt:44-53 — 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/test-disabled/java/com/empathy/ai/testutil/TestDataFactory.kt:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/UsageStatsScreen.kt:84— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/UsageStatsScreen.kt:84-93 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:96-105 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/UsageStatsScreen.kt:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `viewModel` to `UsageStatsViewModel = hiltViewModel()` in one and `BrainTagViewModel = hiltViewModel()` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:1169— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:1169-1178 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactListViewModel.kt:334-343 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:651— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:651-660 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:668-677 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:651` 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.
ClassTooLong: FloatingWindowService app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:78— ClassTooLong — 2122 significant lines (blank, comment-only and punctuation-only lines excluded), 87 methods. The bar is 400 significant lines; this is 1722 over it, 5.31× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FloatingView app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:44— ClassTooLong — 1753 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 400 significant lines; this is 1353 over it, 4.38× 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: AiRepositoryImpl data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:86— ClassTooLong — 1005 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 605 over it, 2.51× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ContactDetailTabViewModel presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:85— ClassTooLong — 914 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods. The bar is 400 significant lines; this is 514 over it, 2.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: ContactDetailViewModel presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:71— ClassTooLong — 709 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 400 significant lines; this is 309 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AiAdvisorChatViewModel presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:73— ClassTooLong — 602 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 202 over it, 1.51× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AiConfigViewModel presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt:38— ClassTooLong — 529 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 129 over it, 1.32× 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: SettingsViewModel presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:64— ClassTooLong — 421 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 21 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.
Duplicated block (17 lines × 2) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:702— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:702-718 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:796-812 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:702` 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:108— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:108-124 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt:104-120 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:108` 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:381— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:381-397 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:343-359 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:381` 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 (17 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AddProviderScreen.kt:195— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AddProviderScreen.kt:195-211 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/EditProviderScreen.kt:205-221 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AddProviderScreen.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.
Duplicated block (17 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1037— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1037-1053 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1055-1071 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1037` 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 (17 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/ListView.kt:126— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/ListView.kt:126-142 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/TimelineView.kt:371-387 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/ListView.kt:126` 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:124— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:124-140 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:141-157 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:432— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:432-448 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:442-458 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:432` 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 (14 lines × 2) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:908— app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:908-921 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1494-1507 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:905` calls `clear` and `app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1491` 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 (14 lines × 2) domain/src/main/kotlin/com/empathy/ai/domain/usecase/RefinementUseCase.kt:71— domain/src/main/kotlin/com/empathy/ai/domain/usecase/RefinementUseCase.kt:71-84 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/RefinementUseCase.kt:117-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. Read the line range as the matched WINDOW rather than a finished unit: at `domain/src/main/kotlin/com/empathy/ai/domain/usecase/RefinementUseCase.kt:71` 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 (14 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:358— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:358-371 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:407-420 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:358` 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, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:372` calls `listOf`, `KeyEvent` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:421` 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 (14 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:85— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:85-98 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt:81-94 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:85` 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 (14 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/LatestDiscoveryCard.kt:232— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/LatestDiscoveryCard.kt:232-245 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/overview/LatestFactHookCard.kt:195-208 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/CategoryCard.kt:88— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/CategoryCard.kt:88-101 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt:169-182 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/CategoryCard.kt:88` 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 (14 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:655— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:655-668 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:670-683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/AddTagDialog.kt:72— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/AddTagDialog.kt:72-85 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/TagDetailDialog.kt:70-83 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/AddTagDialog.kt:72` 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, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/AddTagDialog.kt:68` calls `mutableStateOf` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/TagDetailDialog.kt:68` 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) data/src/main/kotlin/com/empathy/ai/data/local/ContactRecentHistoryPreferences.kt:47— data/src/main/kotlin/com/empathy/ai/data/local/ContactRecentHistoryPreferences.kt:47-54 | data/src/main/kotlin/com/empathy/ai/data/local/ContactSearchHistoryPreferences.kt:47-54 — 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 (8 lines × 2) data/src/main/kotlin/com/empathy/ai/data/util/DebugLogger.kt:118— data/src/main/kotlin/com/empathy/ai/data/util/DebugLogger.kt:118-125 | presentation/src/main/kotlin/com/empathy/ai/presentation/util/DebugLogger.kt:71-78 — before extracting anything, compare `data/src/main/kotlin/com/empathy/ai/data/util/DebugLogger.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/util/DebugLogger.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) data/src/main/kotlin/com/empathy/ai/data/util/DebugLogger.kt:160— data/src/main/kotlin/com/empathy/ai/data/util/DebugLogger.kt:160-167 | presentation/src/main/kotlin/com/empathy/ai/presentation/util/DebugLogger.kt:90-97 — before extracting anything, compare `data/src/main/kotlin/com/empathy/ai/data/util/DebugLogger.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/util/DebugLogger.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) data/src/main/kotlin/com/empathy/ai/data/repository/BrainTagRepositoryImpl.kt:62— data/src/main/kotlin/com/empathy/ai/data/repository/BrainTagRepositoryImpl.kt:62-69 | data/src/main/kotlin/com/empathy/ai/data/repository/ContactRepositoryImpl.kt:114-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) domain/src/main/kotlin/com/empathy/ai/domain/usecase/CleanupApiUsageUseCase.kt:82— domain/src/main/kotlin/com/empathy/ai/domain/usecase/CleanupApiUsageUseCase.kt:82-89 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/GetApiUsageStatsUseCase.kt:87-94 — 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 (8 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/DeleteConfirmDialog.kt:65— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/DeleteConfirmDialog.kt:65-72 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/persona/BatchDeleteConfirmDialog.kt:22-29 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/DeleteConfirmDialog.kt:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:888— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:888-895 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1079-1086 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:888` 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 (8 lines × 2) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1203— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1203-1210 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1231-1238 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1203` 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.
Low contrast Tailwind colour pair (2.4:1) 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:289— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.4:1) 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:305— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.4:1) 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:321— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.4:1) 文档/开发文档/UI-原型/PRD20/联系人详情/资料库页.html:121— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.4:1) 文档/开发文档/UI-原型/PRD20/联系人详情/资料库页.html:135— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.4:1) 文档/开发文档/UI-原型/PRD20/联系人详情/资料库页.html:149— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.4:1) 文档/开发文档/UI-原型/PRD20/联系人详情/资料库页.html:163— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×7
Edited copy of a member (9 corresponding lines) domain/src/main/kotlin/com/empathy/ai/domain/usecase/GetApiUsageStatsUseCase.kt:112— domain/src/main/kotlin/com/empathy/ai/domain/usecase/GetApiUsageStatsUseCase.kt:112-120 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/GetApiUsageStatsUseCase.kt:125-133 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:305— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:305-313 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernTimelineView.kt:262-270 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:292— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:292-300 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernTimelineView.kt:249-257 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/SparklineChart.kt:112— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/SparklineChart.kt:112-120 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/HealthScoreCardV2.kt:314-323 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/SparklineChart.kt:137— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/SparklineChart.kt:137-145 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/HealthScoreCardV2.kt:327-336 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/SparklineChart.kt:149— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/SparklineChart.kt:149-157 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/HealthScoreCardV2.kt:340-349 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:1213— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:1213-1221 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SessionHistoryViewModel.kt:125-137 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×7
Edited copy of a member (8 corresponding lines) data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:182— data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:182-191 | data/src/main/kotlin/com/empathy/ai/data/repository/DailySummaryRepositoryImpl.kt:135-142 — 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) data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:89— data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:89-96 | data/src/main/kotlin/com/empathy/ai/data/repository/DailySummaryRepositoryImpl.kt:197-204 — 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) data/src/main/kotlin/com/empathy/ai/data/local/entity/AiAdvisorMessageBlockEntity.kt:106— data/src/main/kotlin/com/empathy/ai/data/local/entity/AiAdvisorMessageBlockEntity.kt:106-113 | data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:369-376 — 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) data/src/main/kotlin/com/empathy/ai/data/repository/ContactRepositoryImpl.kt:142— data/src/main/kotlin/com/empathy/ai/data/repository/ContactRepositoryImpl.kt:142-150 | data/src/main/kotlin/com/empathy/ai/data/repository/TopicRepositoryImpl.kt:66-73 — 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) data/src/main/kotlin/com/empathy/ai/data/repository/DailySummaryRepositoryImpl.kt:88— data/src/main/kotlin/com/empathy/ai/data/repository/DailySummaryRepositoryImpl.kt:88-95 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/GetApiUsageStatsUseCase.kt:55-62 — 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) data/src/main/kotlin/com/empathy/ai/data/repository/FailedTaskRepositoryImpl.kt:122— data/src/main/kotlin/com/empathy/ai/data/repository/FailedTaskRepositoryImpl.kt:122-129 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/ExportApiUsageUseCase.kt:22-29 — 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) domain/src/main/kotlin/com/empathy/ai/domain/util/CategoryColorAssigner.kt:163— domain/src/main/kotlin/com/empathy/ai/domain/util/CategoryColorAssigner.kt:163-170 | presentation/src/main/kotlin/com/empathy/ai/presentation/theme/CategoryColorPalette.kt:168-175 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (13 lines × 2) data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:487— data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:487-499 | data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:504-516 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:487` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:608— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:608-620 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:643-655 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:608` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:642` calls `Success` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:607` 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 (13 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/AiInferenceSection.kt:89— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/AiInferenceSection.kt:89-101 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/component/ThinkingSection.kt:81-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/AiInferenceSection.kt:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1205— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1205-1217 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1230-1242 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1205` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/AddTagDialog.kt:163— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/AddTagDialog.kt:163-175 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/TagDetailDialog.kt:104-116 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/AddTagDialog.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 (13 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/AddContactDialog.kt:62— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/AddContactDialog.kt:62-74 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/AddContactDialog.kt:79-91 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/AddContactDialog.kt:62` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:351— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:351-363 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:403-415 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:351` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×6
Edited copy of a member (12 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/tag/MacaronTagChip.kt:39— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/tag/MacaronTagChip.kt:39-52 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt:292-303 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/LatestDiscoveryCard.kt:278— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/LatestDiscoveryCard.kt:278-290 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/overview/LatestFactHookCard.kt:237-248 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/LatestDiscoveryCard.kt:251— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/LatestDiscoveryCard.kt:251-263 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/overview/LatestFactHookCard.kt:214-225 — 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/test-disabled/java/com/empathy/ai/testutil/TestDataFactory.kt:92— app/src/test-disabled/java/com/empathy/ai/testutil/TestDataFactory.kt:92-103 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/text/AutoSizeText.kt:116-130 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:238— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:238-249 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:913-924 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/AddTagDialog.kt:235— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/AddTagDialog.kt:235-246 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:533-544 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (15 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:943— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:943-957 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1184-1198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:943` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) domain/src/main/kotlin/com/empathy/ai/domain/service/PrivacyEngine.kt:141— domain/src/main/kotlin/com/empathy/ai/domain/service/PrivacyEngine.kt:141-155 | domain/src/main/kotlin/com/empathy/ai/domain/service/PrivacyEngine.kt:237-251 — 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 `domain/src/main/kotlin/com/empathy/ai/domain/service/PrivacyEngine.kt:141` 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:246— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:246-260 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt:158-172 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:246` 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:140— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:140-154 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:197-211 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 136 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:448— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:448-462 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:563-577 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:448` 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:155— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:155-169 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:176-190 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:155` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
AC3 · Page structure· Heading level jumps from h1 to h3 · ×5
Heading level jumps from h1 to h3 文档/开发文档/UI-原型/PRD21/AI配置-iOS风格.html:61— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 文档/开发文档/UI-原型/PRD21/index.html:44— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 文档/开发文档/UI-原型/PRD21/个人画像-iOS风格.html:87— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 文档/开发文档/UI-原型/废弃/simplified-settings.html:321— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 文档/开发文档/UI-原型/废弃/warm-gold-theme.html:339— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Low contrast Tailwind colour pair (3.1:1) 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:64— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (3.1:1) 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:83— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (3.1:1) 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:288— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (3.1:1) 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:462— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (3.1:1) 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:215— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Focus outline removed inline 文档/开发文档/UI-原型/PRD19/empathy-prompt-editor-v2.html:71— <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline 文档/开发文档/UI-原型/PRD20/联系人详情/新建联系人页.html:64— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline 文档/开发文档/UI-原型/PRD20/联系人详情/新建联系人页.html:72— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:78— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline 文档/开发文档/UI-原型/PRD21/AI配置-iOS风格.html:50— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×5
Edited copy of a member (29 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:592— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:592-620 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:624-655 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:496— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:496-524 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:1185-1214 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) domain/src/main/kotlin/com/empathy/ai/domain/service/SessionContextService.kt:125— domain/src/main/kotlin/com/empathy/ai/domain/service/SessionContextService.kt:125-153 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/AnalyzeChatUseCase.kt:291-319 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:837— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:837-865 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:871-899 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:368— app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:368-396 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:403-431 — 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 (21 corresponding lines) · ×5
Edited copy of a member (21 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:313— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:313-338 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:927-947 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:233— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:233-253 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:257-277 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ProviderCard.kt:250— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ProviderCard.kt:250-270 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:349-370 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/component/RegenerateButton.kt:39— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/component/RegenerateButton.kt:39-59 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/component/StopGenerationButton.kt:40-61 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.kt:461— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.kt:461-482 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.kt:537-557 — 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.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×4
Animation without a prefers-reduced-motion guard 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:105— `.animate-fade-in` moves (`animation: fadeIn 0.4s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:68— `.segment-slider` moves (`transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:114— `.animate-fade-in` moves (`animation: fadeInUp 0.4s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard 文档/开发文档/UI-原型/PRD20/联系人详情/资料库页.html:28— `.animate-fade-in` moves (`animation: fadeIn 0.4s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Stateful singleton: PerformanceMonitor app/src/main/java/com/empathy/ai/domain/util/PerformanceMonitor.kt:46— `PerformanceMonitor` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (isMonitoring, lastFrameTime, frameTimesMs, consecutiveSlowFrames, memorySnapshots; e.g. `isMonitoring` in `startMonitoring` at line 128).
Stateful singleton: SseStreamReader data/src/main/kotlin/com/empathy/ai/data/remote/SseStreamReader.kt:42— `SseStreamReader` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (consecutiveFailures; e.g. `consecutiveFailures` in `stream` at line 62).
Stateful singleton: SystemPromptRepositoryImpl data/src/main/kotlin/com/empathy/ai/data/repository/SystemPromptRepositoryImpl.kt:23— `SystemPromptRepositoryImpl` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (cachedConfig; e.g. `cachedConfig` in `getConfig` at line 31).
Stateful singleton: BlockUpdateManager data/src/main/kotlin/com/empathy/ai/data/util/BlockUpdateManager.kt:41— `BlockUpdateManager` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (lastBlockType; e.g. `lastBlockType` in `smartUpdate` at line 82).
TodoComment presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:286— // TODO: 需要添加createdAt字段到ContactProfile — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1669— // TODO: 从系统设置获取深色模式状态 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/prompt/PromptEditorScreen.kt:266— // TODO: AI优化功能 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailTabScreen.kt:781— // TODO: 从状态获取已有总结日期 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×4
Edited copy of a member (19 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/state/EditedBadge.kt:33— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/state/EditedBadge.kt:33-53 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/state/EditedBadge.kt:61-79 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) data/src/main/kotlin/com/empathy/ai/data/local/ContactRecentHistoryPreferences.kt:27— data/src/main/kotlin/com/empathy/ai/data/local/ContactRecentHistoryPreferences.kt:27-45 | data/src/main/kotlin/com/empathy/ai/data/local/ContactSearchHistoryPreferences.kt:27-45 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:529— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:529-547 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:1221-1239 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ConversationCard.kt:159— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ConversationCard.kt:159-178 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/ListViewRow.kt:211-229 — 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 (16 corresponding lines) · ×4
Edited copy of a member (16 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:177— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:177-192 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:196-211 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/filter/FilterChipRow.kt:72— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/filter/FilterChipRow.kt:72-89 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:314-329 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/DraggableModelList.kt:299— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/DraggableModelList.kt:299-316 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/DraggableModelList.kt:320-335 — 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) domain/src/main/kotlin/com/empathy/ai/domain/usecase/ManageCustomDimensionUseCase.kt:62— domain/src/main/kotlin/com/empathy/ai/domain/usecase/ManageCustomDimensionUseCase.kt:62-82 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/RemoveUserProfileTagUseCase.kt:22-37 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (22 lines × 2) domain/src/main/kotlin/com/empathy/ai/domain/usecase/ManualSummaryUseCase.kt:271— domain/src/main/kotlin/com/empathy/ai/domain/usecase/ManualSummaryUseCase.kt:271-292 | domain/src/main/kotlin/com/empathy/ai/domain/util/AiSummaryProcessor.kt:203-224 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (22 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:104— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:104-125 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:148-169 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 136 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:104` 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 (22 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:180— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:180-201 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt:176-197 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:180` 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 (22 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:540— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:540-561 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt:313-334 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) domain/src/main/kotlin/com/empathy/ai/domain/usecase/EditContactInfoUseCase.kt:56— domain/src/main/kotlin/com/empathy/ai/domain/usecase/EditContactInfoUseCase.kt:56-64 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/EditContactInfoUseCase.kt:106-114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/EmotionTimelineNode.kt:68— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/EmotionTimelineNode.kt:68-76 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:279-287 — 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 (9 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1255— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1255-1263 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1276-1284 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1255` 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) data/src/main/kotlin/com/empathy/ai/data/util/DebugLogger.kt:138— data/src/main/kotlin/com/empathy/ai/data/util/DebugLogger.kt:138-146 | presentation/src/main/kotlin/com/empathy/ai/presentation/util/DebugLogger.kt:80-88 — before extracting anything, compare `data/src/main/kotlin/com/empathy/ai/data/util/DebugLogger.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/util/DebugLogger.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:111— data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:111-118 | data/src/main/kotlin/com/empathy/ai/data/repository/DailySummaryRepositoryImpl.kt:99-106 | data/src/main/kotlin/com/empathy/ai/data/repository/FailedTaskRepositoryImpl.kt:102-109 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:170— data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:170-177 | data/src/main/kotlin/com/empathy/ai/data/repository/DailySummaryRepositoryImpl.kt:219-226 | data/src/main/kotlin/com/empathy/ai/data/repository/FailedTaskRepositoryImpl.kt:91-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:170` 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 × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:479— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:479-486 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:522-529 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt:104-111 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) data/src/main/kotlin/com/empathy/ai/data/repository/ContactRepositoryImpl.kt:174— data/src/main/kotlin/com/empathy/ai/data/repository/ContactRepositoryImpl.kt:174-181 | data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:66-73 | data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:159-166 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `data/src/main/kotlin/com/empathy/ai/data/repository/ContactRepositoryImpl.kt:174` 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.
Low contrast Tailwind colour pair (3.3:1) 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:412— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (3.3:1) 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:246— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (3.3:1) 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:260— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.5:1) 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:292— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.5:1) 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:308— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.5:1) 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:324— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:444— app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:444-730 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1045-1117 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:2086-2182 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/floating/RefinementOverlay.kt:176-186 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1432— app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1432-1482 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1534-1589 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1598-1653 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1660-1705 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:346— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:346-391 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:395-435 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/ListView.kt:118-164 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/TimelineView.kt:363-407 — 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 (32 corresponding lines) · ×3
Edited copy of a member (32 corresponding lines) domain/src/main/kotlin/com/empathy/ai/domain/usecase/RefinementUseCase.kt:63— domain/src/main/kotlin/com/empathy/ai/domain/usecase/RefinementUseCase.kt:63-95 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/RefinementUseCase.kt:110-141 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:756— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:756-787 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1009-1040 — 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) domain/src/main/kotlin/com/empathy/ai/domain/model/UserProfile.kt:127— domain/src/main/kotlin/com/empathy/ai/domain/model/UserProfile.kt:127-158 | domain/src/main/kotlin/com/empathy/ai/domain/model/UserProfile.kt:167-198 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×3
Edited copy of a member (37 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1594— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1594-1630 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModelWithDebug.kt:174-221 — 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.
Edited copy of a member (37 corresponding lines) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:900— app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:900-945 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1489-1525 — 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.
Edited copy of a member (37 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:398— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:398-441 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AiConfigScreen.kt:324-360 — 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 (31 corresponding lines) · ×3
Edited copy of a member (31 corresponding lines) domain/src/main/kotlin/com/empathy/ai/domain/util/UserProfileContextBuilder.kt:160— domain/src/main/kotlin/com/empathy/ai/domain/util/UserProfileContextBuilder.kt:160-195 | domain/src/main/kotlin/com/empathy/ai/domain/util/UserProfileContextBuilder.kt:231-261 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ImagePreviewDialog.kt:112— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ImagePreviewDialog.kt:112-142 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ImagePreviewView.kt:190-220 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:600— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:600-630 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:639-677 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×3
Edited copy of a member (27 corresponding lines) domain/src/main/kotlin/com/empathy/ai/domain/usecase/EditContactInfoUseCase.kt:152— domain/src/main/kotlin/com/empathy/ai/domain/usecase/EditContactInfoUseCase.kt:152-180 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/EditContactInfoUseCase.kt:194-220 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AddProviderScreen.kt:357— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AddProviderScreen.kt:357-383 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/EditProviderScreen.kt:329-358 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SystemPromptEditViewModel.kt:96— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SystemPromptEditViewModel.kt:96-123 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SystemPromptEditViewModel.kt:128-154 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×3
Edited copy of a member (10 corresponding lines) data/src/main/kotlin/com/empathy/ai/data/repository/ProviderCompatibility.kt:35— data/src/main/kotlin/com/empathy/ai/data/repository/ProviderCompatibility.kt:35-44 | data/src/main/kotlin/com/empathy/ai/data/repository/ProviderCompatibility.kt:88-98 — 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) data/src/main/kotlin/com/empathy/ai/data/local/ContactSortPreferences.kt:28— data/src/main/kotlin/com/empathy/ai/data/local/ContactSortPreferences.kt:28-37 | data/src/main/kotlin/com/empathy/ai/data/repository/settings/SettingsRepositoryImpl.kt:131-140 — 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) domain/src/main/kotlin/com/empathy/ai/domain/model/AiAdvisorConversation.kt:68— domain/src/main/kotlin/com/empathy/ai/domain/model/AiAdvisorConversation.kt:68-80 | domain/src/main/kotlin/com/empathy/ai/domain/model/AiAdvisorSession.kt:66-75 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×3
Edited copy of a member (17 corresponding lines) data/src/main/kotlin/com/empathy/ai/data/repository/PrivacyRepositoryImpl.kt:60— data/src/main/kotlin/com/empathy/ai/data/repository/PrivacyRepositoryImpl.kt:60-76 | data/src/main/kotlin/com/empathy/ai/data/repository/PrivacyRepositoryImpl.kt:78-94 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:219— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:219-240 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/RecordApiUsageUseCase.kt:55-71 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SystemPromptEditScreen.kt:45— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SystemPromptEditScreen.kt:45-64 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:63-79 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/AddTagButton.kt:92— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/AddTagButton.kt:92-102 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/EditableTag.kt:113-123 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFilterChips.kt:98— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFilterChips.kt:98-108 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/filter/FilterChipRow.kt:97-107 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFilterChips.kt:112— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFilterChips.kt:112-122 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/filter/FilterChipRow.kt:111-121 — 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 (14 corresponding lines) · ×3
Edited copy of a member (14 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/ProxySettingsDialog.kt:266— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/ProxySettingsDialog.kt:266-279 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/UsageStatsScreen.kt:264-279 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2440— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2440-2457 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3263-3276 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/MilestoneCard.kt:82— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/MilestoneCard.kt:82-96 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/ListViewRow.kt:258-271 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×3
Edited copies of one member (3 members, 12+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TemperatureSlider.kt:203— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TemperatureSlider.kt:203-214 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:304-315 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt:312-323 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TemperatureSlider.kt:218— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TemperatureSlider.kt:218-229 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:319-330 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt:327-338 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TemperatureSlider.kt:248— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TemperatureSlider.kt:248-259 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:334-345 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt:342-353 — 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.
Duplicated block (26 lines × 2) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:669— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:669-694 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:763-788 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:669` 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 (26 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:85— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:85-110 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/HealthScoreCardV2.kt:189-214 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:85` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/HealthScoreCardV2.kt:217` calls `Column` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:113` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (26 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/component/StreamingMessageBubble.kt:70— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/component/StreamingMessageBubble.kt:70-95 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/component/StreamingMessageBubble.kt:235-260 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/component/StreamingMessageBubble.kt:70` 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 (24 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2166— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2166-2189 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3378-3401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2166` 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/java/com/empathy/ai/service/FloatingWindowService.kt:3377` calls `handleKnowledgeV2` and `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2165` 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 (24 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:571— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:571-594 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt:345-368 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (24 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt:235— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt:235-258 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt:581-604 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt:235` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 3) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1455— app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1455-1470 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1562-1577 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1626-1641 — 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/java/com/empathy/ai/domain/util/FloatingView.kt:1455` 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 (16 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:317— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:317-332 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt:219-234 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:760-780 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:317` 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 (16 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:201— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:201-216 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:250-265 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt:162-177 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:440— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:440-452 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:633-645 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1503-1515 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:440` 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, `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:438` calls `e` and `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:631` 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 × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:241— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:241-253 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernTimelineView.kt:344-356 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:306-318 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 136 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:241` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/CategoryCard.kt:90— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/CategoryCard.kt:90-102 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:309-321 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt:171-183 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/CategoryCard.kt:90` 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 (12 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/state/EditedBadge.kt:36— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/state/EditedBadge.kt:36-47 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/state/EditedBadge.kt:62-73 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/state/EditedBadge.kt:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/state/EditedBadge.kt:34` calls `formatRelativeTime` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/state/EditedBadge.kt:61` 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 (12 lines × 2) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1020— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1020-1031 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1070-1081 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/emotion/EmotionalTimelineNode.kt:71— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/emotion/EmotionalTimelineNode.kt:71-82 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/EmotionTimelineNode.kt:104-115 — 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.
X2 · Cancellation propagation· Suspend function with a blocking request · ×3
Suspend function with a blocking request: testConnection data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:176— `testConnection` 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: fetchAvailableModels data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:284— `fetchAvailableModels` 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: testProxyConnection data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:528— `testProxyConnection` 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`.
Low contrast Tailwind colour pair (3.7:1) 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:45— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (3.7:1) 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:121— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.2:1) 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:102— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.2:1) 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:137— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Repeated repair: data/src/main/kotlin/com/empathy/ai/data/local/FloatingWindowPreferences.kt data/src/main/kotlin/com/empathy/ai/data/local/FloatingWindowPreferences.kt:322— data/src/main/kotlin/com/empathy/ai/data/local/FloatingWindowPreferences.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 8 (its worst body is FloatingWindowPreferences.getMediaProjectionPermissionInternal at line 322), 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: 修复Android 14+截图权限缓存与预览视图问题 (BUG-00075)”; “fix: 移除截图授权崩溃并更新版本”; “fix: 修复截图权限缓存与MediaProjection恢复”; “fix: BUG-00072 截图权限与截图流程修复”. 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 2025-10-26..2026-01-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-10-26 08:01:47 +00:00' --until='2026-01-24 08:01:47 +00:00' --full-history --no-merges -- data/src/main/kotlin/com/empathy/ai/data/local/FloatingWindowPreferences.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/java/com/empathy/ai/ui/ScreenshotPermissionActivity.kt app/src/main/java/com/empathy/ai/ui/ScreenshotPermissionActivity.kt:39— app/src/main/java/com/empathy/ai/ui/ScreenshotPermissionActivity.kt changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is ScreenshotPermissionActivity.onActivityResult at line 39), 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: 移除截图授权崩溃并更新版本”; “fix: 修复截图权限缓存与MediaProjection恢复”; “fix: BUG-00072 截图权限与截图流程修复”; “refactor: 迁移 FloatingWindowService 至 app 层 (BUG-00073)”. 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 2025-10-26..2026-01-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2025-10-26 08:01:47 +00:00' --until='2026-01-24 08:01:47 +00:00' --full-history --no-merges -- app/src/main/java/com/empathy/ai/ui/ScreenshotPermissionActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication· Edited copy of a member (62 corresponding lines) · ×2
Edited copy of a member (62 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFloatingSearchBar.kt:57— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFloatingSearchBar.kt:57-124 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSSearchBar.kt:56-117 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (62 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:581— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:581-642 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:644-705 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (44 corresponding lines) · ×2
Edited copy of a member (44 corresponding lines) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:477— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:477-520 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:522-569 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (44 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:412— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:412-455 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:422-476 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×2
Edited copy of a member (26 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/BrainTagViewModel.kt:216— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/BrainTagViewModel.kt:216-249 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:395-420 — 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) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactListViewModel.kt:216— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactListViewModel.kt:216-241 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactListViewModel.kt:401-432 — 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 (20 corresponding lines) · ×2
Edited copy of a member (20 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/emotion/GlassmorphicCard.kt:101— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/emotion/GlassmorphicCard.kt:101-120 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/emotion/GlassmorphicCard.kt:124-144 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TemperatureSlider.kt:166— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TemperatureSlider.kt:166-185 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/UsageOverviewCard.kt:86-105 — 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.
Duplicated block (36 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:313— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:313-348 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt:215-250 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:313` 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 (36 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:128— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:128-163 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt:124-159 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:128` 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 (32 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/ContactSearchBar.kt:57— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/ContactSearchBar.kt:57-88 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/TagSearchBar.kt:53-84 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/ContactSearchBar.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/TagSearchBar.kt` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/ContactSearchBar.kt:57` 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 (32 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:389— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:389-420 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:831-862 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:389` 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 (19 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:102— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:102-120 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:163-181 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:102` 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 (19 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:417— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:417-435 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:448-466 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:417` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 3) domain/src/main/kotlin/com/empathy/ai/domain/usecase/AnalyzeChatUseCase.kt:151— domain/src/main/kotlin/com/empathy/ai/domain/usecase/AnalyzeChatUseCase.kt:151-168 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/GenerateReplyUseCase.kt:101-118 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/PolishDraftUseCase.kt:99-116 — before extracting anything, compare `domain/src/main/kotlin/com/empathy/ai/domain/usecase/GenerateReplyUseCase.kt` and `domain/src/main/kotlin/com/empathy/ai/domain/usecase/PolishDraftUseCase.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `domain/src/main/kotlin/com/empathy/ai/domain/usecase/AnalyzeChatUseCase.kt:151` 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 (18 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditConversationDialog.kt:177— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditConversationDialog.kt:177-194 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:253-270 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt:165-182 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditConversationDialog.kt:177` 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 (17–18 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/PastelTagsCard.kt:178— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/PastelTagsCard.kt:178-194 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/overview/OverviewTab.kt:141-158 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/PastelTagsCard.kt:178` 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 (17–18 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:309— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:309-325 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt:171-188 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:309` 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 (17 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditConversationDialog.kt:271— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditConversationDialog.kt:271-287 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:351-367 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt:253-269 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditConversationDialog.kt:271` 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 (17 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TemperatureSlider.kt:70— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TemperatureSlider.kt:70-86 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:90-106 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt:86-102 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TemperatureSlider.kt:70` 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–16 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:306— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:306-320 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:453-468 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:306` 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–16 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:376— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:376-391 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:421-435 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:376` 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) domain/src/main/kotlin/com/empathy/ai/domain/usecase/AddTagUseCase.kt:45— domain/src/main/kotlin/com/empathy/ai/domain/usecase/AddTagUseCase.kt:45-59 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/AddUserProfileTagUseCase.kt:32-45 — 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 `domain/src/main/kotlin/com/empathy/ai/domain/usecase/AddTagUseCase.kt:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:373— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:373-386 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/TimelineView.kt:390-404 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:373` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13–14 lines × 2) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:592— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:592-604 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1430-1443 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:592` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1445` calls `supportsResponseFormat`, `toDouble` and `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:605` 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–14 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chip/ConfirmedTag.kt:69— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chip/ConfirmedTag.kt:69-81 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chip/GuessedTag.kt:217-230 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chip/ConfirmedTag.kt:69` 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/java/com/empathy/ai/domain/util/FloatingView.kt:2803— app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:2803-2815 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:721-732 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:2803` 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/java/com/empathy/ai/domain/util/FloatingView.kt:2816` calls `Suppress` and `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:733` 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 (12–13 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:656— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:656-667 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:689-701 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:656` 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 × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFilterChips.kt:73— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFilterChips.kt:73-84 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:198-209 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/QuickDateOptions.kt:85-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFilterChips.kt:73` 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 × 3) data/src/main/kotlin/com/empathy/ai/data/local/ApiKeyStorage.kt:73— data/src/main/kotlin/com/empathy/ai/data/local/ApiKeyStorage.kt:73-85 | data/src/main/kotlin/com/empathy/ai/data/local/UserProfilePreferences.kt:61-72 | data/src/main/kotlin/com/empathy/ai/data/repository/settings/SettingsRepositoryImpl.kt:71-84 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `data/src/main/kotlin/com/empathy/ai/data/local/ApiKeyStorage.kt:73` 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 lines × 3) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:708— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:708-718 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:802-812 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1468-1478 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:708` 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 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ProviderCard.kt:163— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ProviderCard.kt:163-173 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ProviderCard.kt:194-204 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ProviderCard.kt:216-226 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ProviderCard.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 (10 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:372— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:372-381 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/ListView.kt:144-153 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/TimelineView.kt:389-398 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:372` 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 (10 lines × 3) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:898— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:898-907 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:932-941 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:965-974 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/UsageStatsUiState.kt:111— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/UsageStatsUiState.kt:111-116 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/UsageStatsUiState.kt:119-124 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/UsageStatsUiState.kt:127-132 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/UsageStatsUiState.kt:119` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/UsageStatsUiState.kt:118` calls `set` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/UsageStatsUiState.kt:126` 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 (6 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:604— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:604-609 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:895-900 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1086-1091 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:604` 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) data/src/main/kotlin/com/empathy/ai/data/local/ContactRecentHistoryPreferences.kt:69— data/src/main/kotlin/com/empathy/ai/data/local/ContactRecentHistoryPreferences.kt:69-73 | data/src/main/kotlin/com/empathy/ai/data/local/ContactSearchHistoryPreferences.kt:69-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:256— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:256-260 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/SendAdvisorMessageStreamingUseCase.kt:453-457 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 4) data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:77— data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:77-84 | data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:141-148 | data/src/main/kotlin/com/empathy/ai/data/repository/DailySummaryRepositoryImpl.kt:64-71 | data/src/main/kotlin/com/empathy/ai/data/repository/DailySummaryRepositoryImpl.kt:172-179 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:77` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `contactId` to `String): Result<List<ConversationLog>> = withContext(Dispatchers.IO` in one and `String ): Result<List<DailySummary>> = withContext(Dispatchers.IO` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 4) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:390— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:390-397 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:714-721 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:808-815 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1474-1481 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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.
AC3 · Page structure· More than one main landmark · ×1
More than one main landmark 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:2— A document must expose only one main landmark. Multiple visible <main> (or role="main") elements confuse the landmark map and the "skip to content" target. Keep one; remove or hide the rest.
Low contrast Tailwind colour pair (2.6:1) 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:34— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast colour pair in CSS (4.0:1) 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:78— `.filter-chip-active` sets color: white on background-color: #007AFF — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast Tailwind colour pair (3.6:1) 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:237— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (3.9:1) 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:386— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (4.3:1) 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:437— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.9:1) 文档/开发文档/UI-原型/PRD20/联系人详情/事实流页.html:487— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast colour pair in CSS (3.1:1) 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:86— `.tag-yellow` sets color: #B8860B on background-color: #FFF8E1 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (4.1:1) 文档/开发文档/UI-原型/PRD20/联系人详情/概览页.html:87— `.tag-cyan` sets color: #00838F on background-color: #E0F7FA — 4.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast Tailwind colour pair (4.0:1) 文档/开发文档/UI-原型/PRD20/联系人详情/画像库页.html:201— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
ContactDetailViewModel.onEvent (cyclomatic 56) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:95— ContactDetailViewModel.onEvent has cyclomatic complexity 56 (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.
ContactDetailTabViewModel.onEvent (cyclomatic 49) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:129— ContactDetailTabViewModel.onEvent has cyclomatic complexity 49 (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.
FloatingView.showInputDialog (cyclomatic 29) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:440— FloatingView.showInputDialog has cyclomatic complexity 29 (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.
AiAdvisorChatScreenKt.ChatBubble (cyclomatic 22) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:534— AiAdvisorChatScreenKt.ChatBubble 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.
ProviderFormDialogKt.ProviderFormDialog (cyclomatic 21) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:65— ProviderFormDialogKt.ProviderFormDialog has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FactStreamTabKt.FactStreamTab (cyclomatic 21) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:78— FactStreamTabKt.FactStreamTab has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FloatingView.validateStateConsistency (cyclomatic 20) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1213— FloatingView.validateStateConsistency 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.
FloatingWindowService.performAnalyze (cyclomatic 20) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:802— FloatingWindowService.performAnalyze 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. This shape REPEATS in the file: one other method here (FloatingWindowService.performCheck) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FloatingWindowService.performCheck (cyclomatic 20) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1055— FloatingWindowService.performCheck 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. This shape REPEATS in the file: one other method here (FloatingWindowService.performAnalyze) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
PersonaTabKt.getCategoryEmoji (cyclomatic 19) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/persona/PersonaTab.kt:479— PersonaTabKt.getCategoryEmoji has cyclomatic complexity 19 (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.
FloatingWindowService.onDestroy (cyclomatic 18) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:440— FloatingWindowService.onDestroy 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.
AiAdvisorChatScreenKt.AiAdvisorChatScreen (cyclomatic 18) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:159— AiAdvisorChatScreenKt.AiAdvisorChatScreen 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.
DataVaultTabKt.DataVaultTab (cyclomatic 18) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/vault/DataVaultTab.kt:72— DataVaultTabKt.DataVaultTab has cyclomatic complexity 18 (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.
ContactDetailTabViewModel.confirmEditContactInfo (cyclomatic 18) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1179— ContactDetailTabViewModel.confirmEditContactInfo 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.
AiRepositoryImpl.analyzeChat (cyclomatic 17) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:306— AiRepositoryImpl.analyzeChat 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.
UserProfileScreenKt.UserProfileScreenContent (cyclomatic 17) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:82— UserProfileScreenKt.UserProfileScreenContent 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.
FloatingWindowService.minimizeDialog (cyclomatic 16) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1255— FloatingWindowService.minimizeDialog 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.
DraggableModelListKt.DraggableModelList (cyclomatic 16) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/DraggableModelList.kt:88— DraggableModelListKt.DraggableModelList 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.
ContactDetailScreenKt.ContactDetailScreenContent (cyclomatic 16) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.kt:90— ContactDetailScreenKt.ContactDetailScreenContent 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.
ContactDetailViewModel.onEvent (cognitive 55) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:95— ContactDetailViewModel.onEvent has cognitive complexity 55 (threshold 15). Drivers by points: if/else 55. 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.
ContactDetailTabViewModel.onEvent (cognitive 48) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:129— ContactDetailTabViewModel.onEvent has cognitive complexity 48 (threshold 15). Drivers by points: if/else 48. 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.
FloatingView.showInputDialog (cognitive 41) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:440— FloatingView.showInputDialog has cognitive complexity 41 (threshold 15). Drivers by points: error handling 11 (23 pts), if/else 12 (14 pts), match/switch 2 (4 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.
FloatingWindowService.performAnalyze (cognitive 31) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:802— FloatingWindowService.performAnalyze has cognitive complexity 31 (threshold 15). Drivers by points: error handling 12 (22 pts), if/else 7 (9 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (FloatingWindowService.performCheck) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FloatingWindowService.performCheck (cognitive 31) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1055— FloatingWindowService.performCheck has cognitive complexity 31 (threshold 15). Drivers by points: error handling 12 (22 pts), if/else 7 (9 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (FloatingWindowService.performAnalyze) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
UserProfileScreenKt.UserProfileScreenContent (cognitive 30) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:82— UserProfileScreenKt.UserProfileScreenContent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21 (28 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FloatingView.validateStateConsistency (cognitive 28) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1213— FloatingView.validateStateConsistency has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (23 pts), error handling 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FloatingWindowService.showFloatingView (cognitive 28) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:586— FloatingWindowService.showFloatingView has cognitive complexity 28 (threshold 15). Drivers by points: error handling 10 (19 pts), if/else 6 (9 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AiAdvisorChatScreenKt.ChatBubble (cognitive 28) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:534— AiAdvisorChatScreenKt.ChatBubble has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20 (21 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.
NavGraphKt.NavGraph (cognitive 26) presentation/src/main/kotlin/com/empathy/ai/presentation/navigation/NavGraph.kt:105— NavGraphKt.NavGraph has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23 (26 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.
ProviderFormDialogKt.ProviderFormDialog (cognitive 25) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:65— ProviderFormDialogKt.ProviderFormDialog has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, boolean chains 3, 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.
FactStreamTabKt.FactStreamTab (cognitive 25) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:78— FactStreamTabKt.FactStreamTab has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (20 pts), match/switch 4 (5 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FloatingView.onTouchEvent (cognitive 23) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:200— FloatingView.onTouchEvent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 4 (7 pts), boolean chains 1, match/switch 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.
IOSModelListItemKt.IOSModelListItem (cognitive 23) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSModelListItem.kt:69— IOSModelListItemKt.IOSModelListItem has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContactDetailTabViewModel.confirmEditContactInfo (cognitive 23) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1179— ContactDetailTabViewModel.confirmEditContactInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, match/switch 4 (8 pts), boolean chains 1, error handling 1 (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.
FloatingWindowService.minimizeDialog (cognitive 22) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1255— FloatingWindowService.minimizeDialog has cognitive complexity 22 (threshold 15). Drivers by points: error handling 7 (11 pts), if/else 10 (11 pts) (nesting depth added 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.
AiRepositoryImpl.analyzeChat (cognitive 22) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:306— AiRepositoryImpl.analyzeChat has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 4 (5 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.
ModernFactStreamTabKt.ModernFactStreamTab (cognitive 21) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:57— ModernFactStreamTabKt.ModernFactStreamTab has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), 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.
AiAdvisorChatScreenKt.ChatInputBar (cognitive 21) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:725— AiAdvisorChatScreenKt.ChatInputBar has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FloatingWindowService.rebindToDisplay (cognitive 20) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:327— FloatingWindowService.rebindToDisplay has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 4, 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.
ProviderCardKt.ProviderCard (cognitive 20) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ProviderCard.kt:58— ProviderCardKt.ProviderCard has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. 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.
AvatarPickerKt.AvatarPicker (cognitive 20) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/contact/AvatarPicker.kt:76— AvatarPickerKt.AvatarPicker has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (20 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.
DraggableModelListKt.DraggableModelList (cognitive 20) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/DraggableModelList.kt:88— DraggableModelListKt.DraggableModelList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (15 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.
FloatingWindowService.onDestroy (cognitive 19) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:440— FloatingWindowService.onDestroy has cognitive complexity 19 (threshold 15). Drivers by points: error handling 11 (12 pts), if/else 7 (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.
AiAdvisorChatScreenKt.AiAdvisorChatScreen (cognitive 19) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:159— AiAdvisorChatScreenKt.AiAdvisorChatScreen has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, 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.
ContactDetailScreenKt.ContactDetailScreenContent (cognitive 19) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailScreen.kt:90— ContactDetailScreenKt.ContactDetailScreenContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (15 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 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.
SystemPromptEditScreenKt.SystemPromptEditContent (cognitive 19) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SystemPromptEditScreen.kt:68— SystemPromptEditScreenKt.SystemPromptEditContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 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.
CheckDraftUseCase.invoke (cognitive 18) domain/src/main/kotlin/com/empathy/ai/domain/usecase/CheckDraftUseCase.kt:67— CheckDraftUseCase.invoke has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IOSFormFieldKt.IOSFormField (cognitive 18) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFormField.kt:69— IOSFormFieldKt.IOSFormField has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PersonaTabKt.PersonaTab (cognitive 18) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/persona/PersonaTab.kt:102— PersonaTabKt.PersonaTab has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 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.
UsageStatsScreenKt.UsageStatsScreenContent (cognitive 17) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/UsageStatsScreen.kt:96— UsageStatsScreenKt.UsageStatsScreenContent 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.
MainActivityKt.MainScreen (cognitive 16) app/src/main/java/com/empathy/ai/ui/MainActivity.kt:101— MainActivityKt.MainScreen has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 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.
ModernPersonaTabKt.ModernPersonaTab (cognitive 16) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:82— ModernPersonaTabKt.ModernPersonaTab has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, 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.
TimelineViewKt.TimelineView (cognitive 16) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/TimelineView.kt:86— TimelineViewKt.TimelineView has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, 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.
D4 · Code Duplication· Near-duplicate member family (5 members, 14 shared lines) · ×1
Near-duplicate member family (5 members, 14 shared lines) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:311— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:311-468 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:591-661 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:668-755 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:762-849 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1429-1531 — These 5 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 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 5 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 28 shared lines) · ×1
Near-duplicate member family (4 members, 28 shared lines) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:591— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:591-661 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:668-755 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:762-849 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1429-1531 — These 4 members are variants of one another: a block of 28 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 65 shared lines) · ×1
Near-duplicate member family (3 members, 65 shared lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:180— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:180-268 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:278-366 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:392-539 — These 3 members are variants of one another: a block of 65 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
Near-duplicate member pair (126 shared lines) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:802— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:802-998 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1055-1233 — These two members are variants of one another: 126 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (97 shared lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:75— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:75-227 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt:76-222 — These two members are variants of one another: 97 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (52 shared lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:66— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:66-169 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:92-227 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:76— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:76-367 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt:64-269 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:68-193 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:331-451 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/TagConfirmationDialog.kt:68-227 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:700-847 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:935-1035 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFormField.kt:80— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFormField.kt:80-177 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSModelListItem.kt:83-201 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:98-312 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSSettingsItem.kt:64-165 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/UsageListItem.kt:59-168 — These 5 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 5 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 5 times.
D4 · Code Duplication· Edited copy of a member (113 corresponding lines) · ×1
Edited copy of a member (113 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:294— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:294-406 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt:158-275 — These two members are one piece of code written twice and then edited apart: 113 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (91 corresponding lines) · ×1
Edited copy of a member (91 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/message/ConversationBubble.kt:64— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/message/ConversationBubble.kt:64-158 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/message/ConversationBubble.kt:177-267 — These two members are one piece of code written twice and then edited apart: 91 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (73 corresponding lines) · ×1
Edited copy of a member (73 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:846— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:846-922 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1042-1114 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (101 corresponding lines) · ×1
Edited copy of a member (101 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:345— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:345-470 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:807-907 — These two members are one piece of code written twice and then edited apart: 101 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (80 corresponding lines) · ×1
Edited copy of a member (80 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/ContactSearchBar.kt:56— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/ContactSearchBar.kt:56-135 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/TagSearchBar.kt:52-131 — These two members are one piece of code written twice and then edited apart: 80 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (71 corresponding lines) · ×1
Edited copy of a member (71 corresponding lines) domain/src/main/kotlin/com/empathy/ai/domain/usecase/GenerateReplyUseCase.kt:73— domain/src/main/kotlin/com/empathy/ai/domain/usecase/GenerateReplyUseCase.kt:73-144 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/PolishDraftUseCase.kt:72-142 — These two members are one piece of code written twice and then edited apart: 71 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (67 corresponding lines) · ×1
Edited copy of a member (67 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:54— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:54-120 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/HealthScoreCardV2.kt:141-233 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (43 corresponding lines) · ×1
Edited copy of a member (43 corresponding lines) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3154— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3154-3196 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3206-3258 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:500— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/ContactSelectScreen.kt:500-533 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:489-523 — 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 copies of one member (4 members, 39+ corresponding lines) · ×1
Edited copies of one member (4 members, 39+ corresponding lines) domain/src/main/kotlin/com/empathy/ai/domain/usecase/EditContactInfoUseCase.kt:52— domain/src/main/kotlin/com/empathy/ai/domain/usecase/EditContactInfoUseCase.kt:52-90 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/EditContactInfoUseCase.kt:102-140 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/EditConversationUseCase.kt:40-79 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/EditSummaryUseCase.kt:39-77 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 39 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, 47+ corresponding lines) · ×1
Edited copies of one member (3 members, 47+ corresponding lines) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2879— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2879-2925 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2932-2978 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2985-3031 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 47 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 (55 corresponding lines) · ×1
Edited copy of a member (55 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/component/StreamingMessageBubble.kt:69— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/component/StreamingMessageBubble.kt:69-132 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/component/StreamingMessageBubble.kt:234-288 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:530— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:530-578 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:716-772 — 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 copies of one member (3 members, 35+ corresponding lines) · ×1
Edited copies of one member (3 members, 35+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:506— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:506-540 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:547-585 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:593-629 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 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, 19+ corresponding lines) · ×1
Edited copies of one member (3 members, 19+ corresponding lines) data/src/main/kotlin/com/empathy/ai/data/local/ApiKeyStorage.kt:89— data/src/main/kotlin/com/empathy/ai/data/local/ApiKeyStorage.kt:89-114 | data/src/main/kotlin/com/empathy/ai/data/local/UserProfilePreferences.kt:76-94 | data/src/main/kotlin/com/empathy/ai/data/repository/settings/SettingsRepositoryImpl.kt:88-115 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 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 (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/SummaryDetailDialog.kt:204— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/SummaryDetailDialog.kt:204-236 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/SummaryDetailDialog.kt:265-300 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 32+ corresponding lines) · ×1
Edited copies of one member (3 members, 32+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/ProxyTypePicker.kt:95— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/ProxyTypePicker.kt:95-126 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:239-283 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt:234-278 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 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, 24+ corresponding lines) · ×1
Edited copies of one member (4 members, 24+ corresponding lines) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1191— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1191-1214 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1219-1242 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1247-1284 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1289-1324 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×1
Edited copies of one member (3 members, 21+ corresponding lines) data/src/main/kotlin/com/empathy/ai/data/local/ApiKeyStorage.kt:65— data/src/main/kotlin/com/empathy/ai/data/local/ApiKeyStorage.kt:65-87 | data/src/main/kotlin/com/empathy/ai/data/local/UserProfilePreferences.kt:54-74 | data/src/main/kotlin/com/empathy/ai/data/repository/settings/SettingsRepositoryImpl.kt:62-86 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/AddTagButton.kt:44— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/AddTagButton.kt:44-73 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:539-566 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:156— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:156-180 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/QuickDateOptions.kt:41-67 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/AiSummaryCard.kt:150— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/AiSummaryCard.kt:150-175 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/ListViewRow.kt:233-254 — 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 copies of one member (3 members, 24+ corresponding lines) · ×1
Edited copies of one member (3 members, 24+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SettingsScreen.kt:637— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SettingsScreen.kt:637-660 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SettingsScreen.kt:664-688 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SettingsScreen.kt:692-716 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 25+ corresponding lines) · ×1
Edited copies of one member (3 members, 25+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:238— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:238-262 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:264-288 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:290-318 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) domain/src/main/kotlin/com/empathy/ai/domain/util/UserProfileValidator.kt:47— domain/src/main/kotlin/com/empathy/ai/domain/util/UserProfileValidator.kt:47-69 | domain/src/main/kotlin/com/empathy/ai/domain/util/UserProfileValidator.kt:77-107 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 27+ corresponding lines) · ×1
Edited copies of one member (3 members, 27+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:416— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:416-443 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:447-473 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/chat/ChatScreen.kt:481-512 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 26+ corresponding lines) · ×1
Edited copies of one member (5 members, 26+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:170— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:170-197 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:315-341 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:352-381 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:399-425 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:448-473 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 23+ corresponding lines) · ×1
Edited copies of one member (4 members, 23+ corresponding lines) domain/src/main/kotlin/com/empathy/ai/domain/usecase/AddTagUseCase.kt:43— domain/src/main/kotlin/com/empathy/ai/domain/usecase/AddTagUseCase.kt:43-69 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/AddUserProfileTagUseCase.kt:30-54 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/ManageCustomDimensionUseCase.kt:25-51 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/RemoveTagUseCase.kt:26-48 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 23 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, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:126— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:126-138 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt:169-192 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactSelectViewModel.kt:64-87 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SessionHistoryViewModel.kt:92-114 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ProviderCard.kt:344— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/card/ProviderCard.kt:344-363 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AiConfigScreen.kt:392-417 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AiConfigScreen.kt:425-449 — 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 (15 corresponding lines) · ×1
Edited copy of a member (15 corresponding lines) data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:47— data/src/main/kotlin/com/empathy/ai/data/repository/ConversationRepositoryImpl.kt:47-61 | data/src/main/kotlin/com/empathy/ai/data/repository/FailedTaskRepositoryImpl.kt:43-57 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×1
Edited copies of one member (3 members, 14+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/CategoryCard.kt:159— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/CategoryCard.kt:159-172 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/CategoryCard.kt:176-189 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/CategoryCard.kt:193-206 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×1
Edited copies of one member (3 members, 15+ corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFilterChips.kt:45— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFilterChips.kt:45-60 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/filter/FilterChipRow.kt:47-61 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/prompt/PromptSceneTab.kt:60-78 — 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 copy of a member (7 corresponding lines) · ×1
Edited copy of a member (7 corresponding lines) domain/src/main/kotlin/com/empathy/ai/domain/model/ApiUsageRecord.kt:59— domain/src/main/kotlin/com/empathy/ai/domain/model/ApiUsageRecord.kt:59-65 | domain/src/main/kotlin/com/empathy/ai/domain/model/ApiUsageStats.kt:64-70 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×1
Edited copy of a member (4 corresponding lines) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernTimelineView.kt:241— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernTimelineView.kt:241-244 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/TimelineView.kt:341-344 — 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 (69 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:518— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:518-586 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AddProviderScreen.kt:399-467 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (58 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:232— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:232-289 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:297-354 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (52–54 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/message/ConversationBubble.kt:73— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/message/ConversationBubble.kt:73-126 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/message/ConversationBubble.kt:184-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/message/ConversationBubble.kt:73` 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 (50 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AddProviderScreen.kt:144— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AddProviderScreen.kt:144-193 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/EditProviderScreen.kt:154-203 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AddProviderScreen.kt:144` 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 (44–49 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:422— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:422-470 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:864-907 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:422` 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 (47–49 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:399— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:399-447 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModelWithDebug.kt:254-300 — 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 (46 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/ContactSearchBar.kt:90— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/ContactSearchBar.kt:90-135 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/TagSearchBar.kt:86-131 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/ContactSearchBar.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/TagSearchBar.kt` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/input/ContactSearchBar.kt:90` 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 (38–43 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:121— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:121-163 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:381-418 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:121` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:418` calls `height` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:163` 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 (38–40 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:345— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:345-382 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt:207-246 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/SmartFolderCard.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:345` 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 (37 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:240— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt:240-276 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt:235-271 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TokenLimitInput.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/TimeoutInput.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 (35–36 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:427— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:427-461 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:464-499 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:464` 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 (28–33 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:218— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:218-247 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:318-345 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:479-511 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:218` 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 (31 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/message/ConversationBubble.kt:128— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/message/ConversationBubble.kt:128-158 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/message/ConversationBubble.kt:237-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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/message/ConversationBubble.kt:128` 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 (29 lines × 2) domain/src/main/kotlin/com/empathy/ai/domain/usecase/GenerateReplyUseCase.kt:94— domain/src/main/kotlin/com/empathy/ai/domain/usecase/GenerateReplyUseCase.kt:94-122 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/PolishDraftUseCase.kt:92-120 — before extracting anything, compare `domain/src/main/kotlin/com/empathy/ai/domain/usecase/GenerateReplyUseCase.kt` and `domain/src/main/kotlin/com/empathy/ai/domain/usecase/PolishDraftUseCase.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `domain/src/main/kotlin/com/empathy/ai/domain/usecase/GenerateReplyUseCase.kt:94` 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 (23–26 lines × 2) domain/src/main/kotlin/com/empathy/ai/domain/usecase/ManualSummaryUseCase.kt:246— domain/src/main/kotlin/com/empathy/ai/domain/usecase/ManualSummaryUseCase.kt:246-268 | domain/src/main/kotlin/com/empathy/ai/domain/util/AiSummaryProcessor.kt:73-98 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (20–23 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:249— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:249-268 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:347-366 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:517-539 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:249` 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 (23 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:976— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:976-998 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1211-1233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:976` 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 (30–31 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3161— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3161-3191 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3214-3243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3161` 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 (21–23 lines × 2) domain/src/main/kotlin/com/empathy/ai/domain/service/SessionContextService.kt:129— domain/src/main/kotlin/com/empathy/ai/domain/service/SessionContextService.kt:129-149 | domain/src/main/kotlin/com/empathy/ai/domain/usecase/AnalyzeChatUseCase.kt:293-315 — 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 `domain/src/main/kotlin/com/empathy/ai/domain/service/SessionContextService.kt:129` 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 (21 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AiConfigScreen.kt:397— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AiConfigScreen.kt:397-417 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AiConfigScreen.kt:429-449 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AiConfigScreen.kt:397` 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 (20 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:77— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:77-96 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:137-156 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/overview/HealthScoreCardV2.kt:181-200 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:77` 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, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:159` calls `coerceIn` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/chart/HealthRingChart.kt:99` 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 (18–20 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/DimensionCard.kt:128— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/DimensionCard.kt:128-145 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSSettingsItem.kt:109-128 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/DimensionCard.kt:128` 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 (26–27 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:883— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:883-908 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:911-937 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:911` 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 (17–19 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:187— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:187-203 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:285-301 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:409-427 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:187` 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 (16–19 lines × 2) data/src/main/kotlin/com/empathy/ai/data/local/UserProfilePreferences.kt:55— data/src/main/kotlin/com/empathy/ai/data/local/UserProfilePreferences.kt:55-70 | data/src/main/kotlin/com/empathy/ai/data/repository/settings/SettingsRepositoryImpl.kt:63-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17–19 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:71— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:71-89 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:450-466 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:71` 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 × 3) data/src/main/kotlin/com/empathy/ai/data/local/ApiKeyStorage.kt:90— data/src/main/kotlin/com/empathy/ai/data/local/ApiKeyStorage.kt:90-105 | data/src/main/kotlin/com/empathy/ai/data/local/UserProfilePreferences.kt:77-87 | data/src/main/kotlin/com/empathy/ai/data/repository/settings/SettingsRepositoryImpl.kt:89-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `data/src/main/kotlin/com/empathy/ai/data/local/ApiKeyStorage.kt:90` 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. 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 after the matched lines, `data/src/main/kotlin/com/empathy/ai/data/local/ApiKeyStorage.kt:106` calls `w` and `data/src/main/kotlin/com/empathy/ai/data/repository/settings/SettingsRepositoryImpl.kt:107` 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 (16–18 lines × 3) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:685— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:685-700 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:779-794 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1443-1460 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:685` 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–18 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:68— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:68-85 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:101-115 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 136 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:68` 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, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:94` calls `mutableIntStateOf`, `listOf`, `mutableStateOf` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:66` 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 (17 lines × 7) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:120— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:120-136 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt:80-96 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:76-92 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/IOSAlertDialog.kt:339-355 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/TagConfirmationDialog.kt:86-102 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:710-726 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:943-959 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditSummaryDialog.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditFactDialog.kt:120` 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 (14–16 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:988— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:988-1001 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:1056-1071 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:988` 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 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SettingsScreen.kt:646— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SettingsScreen.kt:646-660 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SettingsScreen.kt:674-688 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SettingsScreen.kt:702-716 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SettingsScreen.kt:646` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 5) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:455— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:455-468 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:648-661 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:742-755 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:836-849 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1518-1531 — all 5 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 `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:455` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 4) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:613— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:613-626 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:722-735 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:816-829 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1482-1495 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 × 3) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:528— app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:528-541 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:652-663 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:2113-2124 — 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/java/com/empathy/ai/domain/util/FloatingView.kt:528` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:543` calls `showError` and `app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:2126` 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–14 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:444— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:444-457 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:559-572 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:660-672 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:444` 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 (2–13 lines × 5) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:556— app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:556-568 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:680-692 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1087-1088 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:2164-2175 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/floating/RefinementOverlay.kt:178-180 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:556` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:556` calls `onTextChanged` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/floating/RefinementOverlay.kt:178` 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–12 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:662— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:662-672 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:751-762 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:662` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:660` calls `Text` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:749` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–12 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:322— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:322-333 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:936-944 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:322` 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 (11 lines × 4) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFormField.kt:102— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFormField.kt:102-112 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSModelListItem.kt:106-116 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:242-252 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSSettingsItem.kt:88-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFormField.kt:102` 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, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFormField.kt:100` calls `fillMaxWidth`, `height` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSModelListItem.kt:105` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:879— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:879-888 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:996-1006 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1033-1043 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:879` 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 after the matched lines, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:888` calls `listOf`, `Fact`, `currentTimeMillis` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1006` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–11 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:908— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:908-916 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1007-1017 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1052-1061 — 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:908` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:916` calls `listOf`, `Fact`, `currentTimeMillis` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1017` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 2) presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt:443— presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt:443-452 | presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt:638-648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 5) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFormField.kt:105— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFormField.kt:105-114 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSModelListItem.kt:109-118 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSProviderCard.kt:245-254 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSSettingsItem.kt:91-100 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/UsageListItem.kt:70-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFormField.kt:105` 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 (8–9 lines × 5) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1000— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1000-1008 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1011-1019 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1037-1044 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1055-1062 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1075-1083 — all 5 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1037` 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, `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1010` calls `listOf` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1046` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:258— presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:258-267 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernTimelineView.kt:359-367 | presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt:323-332 — before extracting anything, compare `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/factstream/FactStreamTab.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 136 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 `presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernFactStreamTab.kt:258` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 2) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:989— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:989-994 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1048-1054 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1048` 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 × 3) data/src/main/kotlin/com/empathy/ai/data/util/AndroidLogger.kt:20— data/src/main/kotlin/com/empathy/ai/data/util/AndroidLogger.kt:20-26 | data/src/main/kotlin/com/empathy/ai/data/util/DebugLogger.kt:64-70 | presentation/src/main/kotlin/com/empathy/ai/presentation/util/DebugLogger.kt:33-39 — before extracting anything, compare `data/src/main/kotlin/com/empathy/ai/data/util/DebugLogger.kt` and `presentation/src/main/kotlin/com/empathy/ai/presentation/util/DebugLogger.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `throwable` to `Throwable?` in one and `Throwable? = null` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 4) app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1464— app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1464-1473 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1571-1580 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1635-1644 | app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1687-1696 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 2) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:847— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:847-853 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1100-1106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:847` 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/java/com/empathy/ai/service/FloatingWindowService.kt:856` calls `cleanupCompletedIndicator` and `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1107` 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 (6 lines × 2) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:515— data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:515-520 | data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:564-569 — 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 `data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:515` 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 (6 lines × 6) app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:894— app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:894-899 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:928-933 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:961-966 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1144-1149 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1175-1180 | app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1202-1207 — all 6 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/java/com/empathy/ai/service/FloatingWindowService.kt:894` 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/java/com/empathy/ai/service/FloatingWindowService.kt:903` calls `cleanupCompletedIndicator` and `app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1151` 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.
Off the main sequence: :domain — :domain: abstractness 0.09, instability 0.00, distance 0.91 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Third-party script without Subresource Integrity 文档/开发文档/UI-原型/PRD19/empathy-contact-list-v4.html:7— `https://cdn.tailwindcss.com` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 21 such include(s) across the repository's markup.
Swallowed exception (empty catch) data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1008— 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.
Orphaned file data/src/main/kotlin/com/empathy/ai/data/repository/AiRepositoryImpl.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailViewModel.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/AiAdvisorChatScreen.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreen.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactListScreen.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file data/src/main/kotlin/com/empathy/ai/data/di/DatabaseModule.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiConfigViewModel.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/ContactDetailTabScreen.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/settings/SettingsScreen.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/SettingsViewModel.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/UserProfileViewModel.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/navigation/NavGraph.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/ProviderFormDialog.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/persona/ModernPersonaTab.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/floating/FloatingViewV2.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/persona/PersonaTab.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/contact/summary/DateRangePickerDialog.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file data/src/main/kotlin/com/empathy/ai/data/repository/AiProviderRepositoryImpl.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactListViewModel.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/advisor/SessionHistoryScreen.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/tag/BrainTagScreen.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/src/main/java/com/empathy/ai/domain/util/PerformanceMonitor.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/dialog/EditContactInfoDialog.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file domain/src/main/kotlin/com/empathy/ai/domain/util/SystemPrompts.kt:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
README/code drift 文档/项目文档/README.md:133— 文档/项目文档/README.md links to `../开发文档/STAT/STAT-00002-代码统计工具使用指南.md`, but `文档/开发文档/STAT/STAT-00002-代码统计工具使用指南.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift 文档/项目文档/README.md:134— 文档/项目文档/README.md links to `../开发文档/STAT/STAT-00001-项目代码统计报告.md`, but `文档/开发文档/STAT/STAT-00001-项目代码统计报告.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift 文档/开发文档/MA/README.md:51— 文档/开发文档/MA/README.md links to `../../../skills/multi-agent-explorer/SKILL.md`, but `skills/multi-agent-explorer/SKILL.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift 文档/开发文档/MA/README.md:52— 文档/开发文档/MA/README.md links to `../../../skills/multi-agent-explorer/references/report-templates.md`, but `skills/multi-agent-explorer/references/report-templates.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift 文档/开发文档/MA/README.md:53— 文档/开发文档/MA/README.md links to `../../../skills/multi-agent-explorer/references/worktree-guide.md`, but `skills/multi-agent-explorer/references/worktree-guide.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift 文档/开发文档/MA/MA/README.md:51— 文档/开发文档/MA/MA/README.md links to `../../../skills/multi-agent-explorer/SKILL.md`, but `文档/skills/multi-agent-explorer/SKILL.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift 文档/开发文档/MA/MA/README.md:52— 文档/开发文档/MA/MA/README.md links to `../../../skills/multi-agent-explorer/references/report-templates.md`, but `文档/skills/multi-agent-explorer/references/report-templates.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift 文档/开发文档/MA/MA/README.md:53— 文档/开发文档/MA/MA/README.md links to `../../../skills/multi-agent-explorer/references/worktree-guide.md`, but `文档/skills/multi-agent-explorer/references/worktree-guide.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift app/src/test/java/com/empathy/ai/data/repository/README.md:175— app/src/test/java/com/empathy/ai/data/repository/README.md links to `../../../docs/05-FixBug/AI响应解析正则表达式错误详细分析报告.md`, but `app/src/test/java/com/empathy/docs/05-FixBug/AI响应解析正则表达式错误详细分析报告.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift app/src/test/java/com/empathy/ai/data/repository/README.md:176— app/src/test/java/com/empathy/ai/data/repository/README.md links to `../../../docs/05-FixBug/AI响应解析Bug修复设计方案.md`, but `app/src/test/java/com/empathy/docs/05-FixBug/AI响应解析Bug修复设计方案.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift app/src/test/java/com/empathy/ai/data/repository/README.md:177— app/src/test/java/com/empathy/ai/data/repository/README.md links to `../../../docs/05-FixBug/正则表达式Bug修复报告.md`, but `app/src/test/java/com/empathy/docs/05-FixBug/正则表达式Bug修复报告.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Silent fallback default in catch data/src/main/kotlin/com/empathy/ai/data/local/AiAdvisorPreferences.kt:279— `readDraftIndex` 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 data/src/main/kotlin/com/empathy/ai/data/local/PromptFileStorage.kt:273— `extractVersionFromJson` swallows every exception into `1` — 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 data/src/main/kotlin/com/empathy/ai/data/local/UserProfileBackupManager.kt:71— `getBackupVersions` 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 data/src/main/kotlin/com/empathy/ai/data/local/UserProfileBackupManager.kt:92— `getBackupCount` swallows every exception into `0` — 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 data/src/main/kotlin/com/empathy/ai/data/local/UserProfileBackupManager.kt:105— `extractTimestamp` 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 data/src/main/kotlin/com/empathy/ai/data/local/converter/FactListConverter.kt:197— `tryParseOldFormat` 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 data/src/main/kotlin/com/empathy/ai/data/local/converter/RoomTypeConverters.kt:77— `toStringMap` swallows every exception into `emptyMap()` — 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 data/src/main/kotlin/com/empathy/ai/data/repository/DailySummaryRepositoryImpl.kt:126— `getRecentSummaries` 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 data/src/main/kotlin/com/empathy/ai/data/repository/PrivacyRepositoryImpl.kt:114— `parseMappingFromJson` swallows every exception into `emptyMap()` — 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 domain/src/main/kotlin/com/empathy/ai/domain/util/DateUtils.kt:87— `parseDate` 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 domain/src/main/kotlin/com/empathy/ai/domain/util/DateUtils.kt:101— `parseDateTime` 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.
Duplicated predicate app/src/main/java/com/empathy/ai/ui/theme/AppTheme.kt:183— `dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S` appears character-identically in 2 files — app/src/main/java/com/empathy/ai/ui/theme/AppTheme.kt, presentation/src/main/kotlin/com/empathy/ai/presentation/theme/Theme.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 presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt:111— `item is TimelineItem.UserFact && onFactEdit != null` appears character-identically in 2 files — presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernListView.kt, presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/factstream/ModernTimelineView.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1548— `result.hasRisk && !result.riskWarning.isNullOrBlank()` appears character-identically in 2 files — app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt, presentation/src/main/kotlin/com/empathy/ai/presentation/ui/floating/ResultCard.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 domain/src/main/kotlin/com/empathy/ai/domain/usecase/SummarizeDailyConversationsUseCase.kt:110— `result.isSuccess && result.getOrNull() == false` appears character-identically in 2 files — domain/src/main/kotlin/com/empathy/ai/domain/usecase/SummarizeDailyConversationsUseCase.kt, presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.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 domain/src/main/kotlin/com/empathy/ai/domain/usecase/SummarizeDailyConversationsUseCase.kt:109— `result.isSuccess && result.getOrNull() == true` appears character-identically in 2 files — domain/src/main/kotlin/com/empathy/ai/domain/usecase/SummarizeDailyConversationsUseCase.kt, presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/AiAdvisorChatViewModel.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2505— `resultCode != Activity.RESULT_OK || data == null` appears character-identically in 2 files — app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt, data/src/main/kotlin/com/empathy/ai/data/local/FloatingWindowPreferences.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 presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AddProviderScreen.kt:135— `uiState.isFormValid && !uiState.isSaving` appears character-identically in 2 files — presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/AddProviderScreen.kt, presentation/src/main/kotlin/com/empathy/ai/presentation/ui/screen/aiconfig/EditProviderScreen.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 presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/contact/FormInputItem.kt:74— `value.isEmpty() && placeholder.isNotEmpty()` appears character-identically in 2 files — presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/contact/FormInputItem.kt, presentation/src/main/kotlin/com/empathy/ai/presentation/ui/component/ios/IOSFormField.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: RepositoryModule (17 abstract methods) data/src/main/kotlin/com/empathy/ai/data/di/RepositoryModule.kt:52— `RepositoryModule` declares 17 abstract methods: `bindContactRepository`, `bindContactSortPreferencesRepository`, `bindContactSearchHistoryRepository`, `bindContactRecentHistoryRepository`, `bindBrainTagRepository`, `bindAiRepository`, `bindSettingsRepository`, `bindPrivacyRepository`, `bindAiProviderRepository`, `bindUserProfileRepository`, `bindFloatingWindowPreferencesRepository`, `bindAiSummaryResponseParser`, `bindCleanupPreferences`, `bindApiUsageRepository`, `bindAiAdvisorRepository`, `bindAiAdvisorPreferencesRepository`, `bindDeveloperModeRepository`. 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: AiAdvisorDao (21 abstract methods) data/src/main/kotlin/com/empathy/ai/data/local/dao/AiAdvisorDao.kt:31— `AiAdvisorDao` declares 21 abstract methods: `insertSession`, `getSessionsByContact`, `getActiveSession`, `getSessionById`, `updateSessionTitle`, `incrementMessageCount`, `deleteSession`, `deleteSessionsByContact`, `getLatestEmptySession`, `updateSessionPinned`, `insertConversation`, `getConversationsBySession`, `getConversationsBySessionFlow`, `getRecentConversations`, `getConversationsBySessionWithLimit`, `deleteConversation`, `clearSessionConversations`, `getConversationCount`, `updateSendStatus`, `updateContentAndStatus`, `updateAiMessageContentAndStatus`. 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: DailySummaryDao (16 abstract methods) data/src/main/kotlin/com/empathy/ai/data/local/dao/DailySummaryDao.kt:22— `DailySummaryDao` declares 16 abstract methods: `insert`, `getSummariesByContact`, `getSummaryByDate`, `hasSummaryForDate`, `deleteByContactId`, `cleanupOldSummaries`, `getRecentSummaries`, `getSummariesInRange`, `getSummarizedDatesInRange`, `deleteSummariesInRange`, `getManualSummaries`, `countMissingDatesInRange`, `getSummariesByType`, `getById`, `updateContent`, `deleteById`. 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: AiAdvisorRepository (26 abstract methods) domain/src/main/kotlin/com/empathy/ai/domain/repository/AiAdvisorRepository.kt:27— `AiAdvisorRepository` declares 26 abstract methods: `createSession`, `getSessions`, `getActiveSession`, `getOrCreateActiveSession`, `getSessionById`, `updateSessionTitle`, `deleteSession`, `getLatestEmptySession`, `updateSessionPinned`, `deleteSessionsByContact`, `saveMessage`, `getConversations`, `getConversationsFlow`, `getRecentConversations`, `getConversationsBySessionWithLimit`, `deleteConversation`, `clearSession`, `getConversationCount`, `saveBlock`, `updateBlockContent`, `getBlocksByMessageId`, `observeBlocksByMessageId`, `updateMessageStatus`, `updateMessageContentAndStatus`, `updateAiMessageContentAndStatus`, `deleteMessage`. 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: DailySummaryRepository (16 abstract methods) domain/src/main/kotlin/com/empathy/ai/domain/repository/DailySummaryRepository.kt:26— `DailySummaryRepository` declares 16 abstract methods: `saveSummary`, `getSummariesByContact`, `getSummaryByDate`, `hasSummaryForDate`, `deleteByContactId`, `cleanupOldSummaries`, `getRecentSummaries`, `getSummariesInRange`, `getSummarizedDatesInRange`, `deleteSummariesInRange`, `getManualSummaries`, `countMissingDatesInRange`, `getSummariesByType`, `getById`, `updateContent`, `deleteSummary`. 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: FloatingWindowPreferencesRepository (43 abstract methods) domain/src/main/kotlin/com/empathy/ai/domain/repository/FloatingWindowPreferencesRepository.kt:24— `FloatingWindowPreferencesRepository` declares 43 abstract methods: `saveState`, `loadState`, `saveEnabled`, `isEnabled`, `clear`, `saveButtonPosition`, `getButtonX`, `getButtonY`, `getButtonPosition`, `saveIndicatorPosition`, `getIndicatorPosition`, `saveRequestInfo`, `getRequestInfo`, `clearRequestInfo`, `saveSelectedTab`, `getSelectedTab`, `getSelectedTabAsActionType`, `saveLastContactId`, `getLastContactId`, `saveInputText`, `getInputText`, `saveUiState`, `restoreUiState`, `restoreUiStateAsObject`, `clearSavedUiState`, `hasSavedUiState`, `saveBubblePosition`, `getBubblePosition`, `saveBubbleState`, `getBubbleState`, `saveMinimizeState`, `getMinimizeStateIfValid`, `clearMinimizeState`, `hasValidMinimizeState`, `saveDisplayMode`, `getDisplayMode`, `shouldStartAsBubble`, `saveDisplayId`, `getDisplayId`, `saveContinuousScreenshotEnabled`, and 3 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.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×3
Projects may be oversized for their cohesion presentation/build.gradle.kts:1— `presentation` (62002 LoC, 779 module-visible types across 48 directories) overshoots its size bounds. 3 of 6 build unit(s) (Gradle) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion domain/build.gradle.kts:1— `domain` (18469 LoC, 547 module-visible types across 5 directories) overshoots its size bounds. 3 of 6 build unit(s) (Gradle) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion data/build.gradle.kts:1— `data` (14611 LoC, 170 module-visible types across 12 directories) overshoots its size bounds. 3 of 6 build unit(s) (Gradle) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Most significant orphaned file · ×3
Most significant orphaned file app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Most significant orphaned file app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Most significant orphaned file presentation/src/main/kotlin/com/empathy/ai/presentation/viewmodel/ContactDetailTabViewModel.kt:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
M2 · Architecture documentation· Architecture diagram out of date · ×3
Architecture diagram out of date 文档/项目文档/README.md:37— `文档/项目文档/README.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `buildSrc`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date 文档/开发文档/DR/DR-00032-TD00017任务清单文档审查报告.md:164— `文档/开发文档/DR/DR-00032-TD00017任务清单文档审查报告.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `buildSrc`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date 文档/开发文档/TDD/TDD-00001-悬浮窗架构设计.md:44— `文档/开发文档/TDD/TDD-00001-悬浮窗架构设计.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `app`, `buildSrc`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
No ADRs found app/build.gradle.kts:8— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `app/build.gradle.kts` makes this repository a deployable product (line 8).
D21 · Naming Consistency· `useNewUI` spells `UI` where 21 names in the project spell it `Ui` · ×1
`useNewUI` spells `UI` where 21 names in the project spell it `Ui` app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:125— 21 of 23 names in project app spell the token `Ui` (21 of 23; unit: names in project app containing `Ui`). Peers: ContactDetailScreenIntegrationTest.defaultUiState (app/src/androidTest-disabled/java/com/empathy/ai/presentation/ui/screen/ContactDetailScreenIntegrationTest.kt:46); UserProfileScreenTest.createDefaultUiState (app/src/androidTest-disabled/java/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreenTest.kt:368); FloatingWindowService.currentUiState (app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:129); FloatingWindowService.updateScreenshotAttachmentsUi (app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2848); FloatingWindowPreferencesExtTest.saveUiState should save all state fields (app/src/test-disabled/java/com/empathy/ai/data/local/FloatingWindowPreferencesExtTest.kt:201). Rename to `useNewUi`. [rule N6]
D21 · Naming Consistency· `fetchAvailableModels should construct correct URL for OpenAI` spells `AI` where 18 names in the project spell it `Ai` · ×1
`fetchAvailableModels should construct correct URL for OpenAI` spells `AI` where 18 names in the project spell it `Ai` app/src/test-disabled/java/com/empathy/ai/data/repository/AiProviderRepositoryFetchModelsTest.kt:77— 18 of 20 names in project app spell the token `Ai` (18 of 20; unit: names in project app containing `Ai`). Peers: com.empathy.ai.integration.UserProfileAiIntegrationTest (app/src/androidTest-disabled/java/com/empathy/ai/integration/UserProfileAiIntegrationTest.kt:23); NotificationModule.provideAiResultNotificationManager (app/src/main/java/com/empathy/ai/di/NotificationModule.kt:45); ErrorHandler.handleAiError (app/src/main/java/com/empathy/ai/domain/util/ErrorHandler.kt:171); ErrorHandler.provideAiRecoveryAdvice (app/src/main/java/com/empathy/ai/domain/util/ErrorHandler.kt:335); ErrorHandler.logAiError (app/src/main/java/com/empathy/ai/domain/util/ErrorHandler.kt:432). Rename to `fetchAvailableModels should construct correct URL for OpenAi`. [rule N6]
D21 · Naming Consistency· `shouldStartAsBubble returns true when display mode is BUBBLE` spells `BUBBLE` where 25 names in the project spell it `Bubble` · ×1
`shouldStartAsBubble returns true when display mode is BUBBLE` spells `BUBBLE` where 25 names in the project spell it `Bubble` app/src/test-disabled/java/com/empathy/ai/domain/service/FloatingWindowServiceBubbleExpandTest.kt:76— 25 of 26 names in project app spell the token `Bubble` (25 of 26; unit: names in project app containing `Bubble`). Peers: FloatingWindowService.floatingBubbleView (app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2325); FloatingWindowService.showFloatingBubble (app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3154); FloatingWindowService.showFloatingBubbleSafe (app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3206); FloatingWindowService.hideFloatingBubble (app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3263); FloatingWindowService.expandFromBubble (app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:3284). Rename to `shouldStartAsBubble returns true when display mode is Bubble`. [rule N6]
D21 · Naming Consistency· `shouldStartAsBubble returns false when display mode is DIALOG` spells `DIALOG` where 23 names in the project spell it `Dialog` · ×1
`shouldStartAsBubble returns false when display mode is DIALOG` spells `DIALOG` where 23 names in the project spell it `Dialog` app/src/test-disabled/java/com/empathy/ai/domain/service/FloatingWindowServiceBubbleExpandTest.kt:89— 23 of 24 names in project app spell the token `Dialog` (23 of 24; unit: names in project app containing `Dialog`). Peers: com.empathy.ai.presentation.ui.screen.userprofile.AddTagDialogTestKt (app/src/androidTest-disabled/java/com/empathy/ai/presentation/ui/screen/userprofile/AddTagDialogTest.kt:1); com.empathy.ai.presentation.ui.screen.userprofile.AddTagDialogTest (app/src/androidTest-disabled/java/com/empathy/ai/presentation/ui/screen/userprofile/AddTagDialogTest.kt:31); AddTagDialogTestKt.TestAddTagDialog (app/src/androidTest-disabled/java/com/empathy/ai/presentation/ui/screen/userprofile/AddTagDialogTest.kt:225); UserProfileFlowTestKt.TestEditTagDialogWithDelete (app/src/androidTest-disabled/java/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileFlowTest.kt:441); FloatingView.inputDialogView (app/src/main/java/com/empathy/ai/domain/util/FloatingView.kt:53). Rename to `shouldStartAsBubble returns false when display mode is Dialog`. [rule N6]
D21 · Naming Consistency· `should mask text before calling AI` spells `AI` where 18 names in the project spell it `Ai` · ×1
`should mask text before calling AI` spells `AI` where 18 names in the project spell it `Ai` app/src/test-disabled/java/com/empathy/ai/domain/usecase/PolishDraftUseCaseTest.kt:196— 18 of 20 names in project app spell the token `Ai` (18 of 20; unit: names in project app containing `Ai`). Peers: com.empathy.ai.integration.UserProfileAiIntegrationTest (app/src/androidTest-disabled/java/com/empathy/ai/integration/UserProfileAiIntegrationTest.kt:23); NotificationModule.provideAiResultNotificationManager (app/src/main/java/com/empathy/ai/di/NotificationModule.kt:45); ErrorHandler.handleAiError (app/src/main/java/com/empathy/ai/domain/util/ErrorHandler.kt:171); ErrorHandler.provideAiRecoveryAdvice (app/src/main/java/com/empathy/ai/domain/util/ErrorHandler.kt:335); ErrorHandler.logAiError (app/src/main/java/com/empathy/ai/domain/util/ErrorHandler.kt:432). Rename to `should mask text before calling Ai`. [rule N6]
D21 · Naming Consistency· `adding tag to new contact should update UI` spells `UI` where 21 names in the project spell it `Ui` · ×1
`adding tag to new contact should update UI` spells `UI` where 21 names in the project spell it `Ui` app/src/test-disabled/java/com/empathy/ai/presentation/viewmodel/ContactDetailViewModelNewContactTagTest.kt:135— 21 of 23 names in project app spell the token `Ui` (21 of 23; unit: names in project app containing `Ui`). Peers: ContactDetailScreenIntegrationTest.defaultUiState (app/src/androidTest-disabled/java/com/empathy/ai/presentation/ui/screen/ContactDetailScreenIntegrationTest.kt:46); UserProfileScreenTest.createDefaultUiState (app/src/androidTest-disabled/java/com/empathy/ai/presentation/ui/screen/userprofile/UserProfileScreenTest.kt:368); FloatingWindowService.currentUiState (app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:129); FloatingWindowService.updateScreenshotAttachmentsUi (app/src/main/java/com/empathy/ai/service/FloatingWindowService.kt:2848); FloatingWindowPreferencesExtTest.saveUiState should save all state fields (app/src/test-disabled/java/com/empathy/ai/data/local/FloatingWindowPreferencesExtTest.kt:201). Rename to `adding tag to new contact should update Ui`. [rule N6]
D28 · Secrets (history)· Rotate the exposed credentials · ×1
Dormant codebase — 449 of 449 significant files have no living knowledge — the codebase as a whole is dormant, not 449 separate risks. Counted over 449 of the 636 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. Re-engage owners or document before change.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No SAST — No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
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/3 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.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) and a Gradle version catalogue — not scanned yet).
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 2 file(s) — `domain/src/main/kotlin/com/empathy/ai/domain/model/ContactProfile.kt`, `domain/src/main/kotlin/com/empathy/ai/domain/usecase/ManualSummaryUseCase.kt` — 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.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) and a Gradle version catalogue — not scanned yet).
0
—
Run 01a1e9ca-66de-71e3-a142-4e13534e41e4 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 167 · Warnings: 585 · Recommendations: 508 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 13:55 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.