Public report of UndefinedYouTube/candyos, published 17 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 17 November 2026, 05:24 UTC · Survey ID cd_3f0e0cfae6b744e8905659215355821c

UndefinedYouTube/candyos

Measured 17 November 2026, 05:23 UTC, at code version fc82a48

First survey, so nothing to compare with yet Bus factor: not measuredKnowledge freshness: not measured

Bus factor is not measured: One contributor carries this repository.

Knowledge freshness is not measured: History too condensed to judge knowledge freshness.

CAI score 45.2out of 100 Weak
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,274 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 0.7 person-years · Weakest lens: Production Readiness, 24.3

Findings by how serious they are

0 critical 1162 serious 44 minor

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

This survey was produced by

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

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

Executive summary

UndefinedYouTube/candyos falls short of our standard for production because we found no working pipeline that builds or tests changes to the code and no automated security scanning of the code, its secrets or its dependencies. It scores 45.2 out of 100 and is rated Weak, and it has no critical findings.

Production Readiness, at 24.3, is the weakest lens and counts most in the score. The best first steps are adding an automated build and test pipeline and adding automated security scanning, each worth about 14.9 points. Raising Production Readiness to 70 would lift the score to about 63.2.

Most of the 1,162 serious findings are in Code Health.

The product code is 108,274 lines, about €100,000 to rebuild.

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

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

If Production Readiness rose from 24.3 to 70, the lowest score rated Strong, the score would rise from 45.2 to about 63.2.

Code composition: what the lines of code are
Product code 96%Tests 4%
Rebuild cost: about €100,000 · Estimate
Cost to rebuild€33,000 to €170,000, for 554 to 1,758 hours of work, about 0.7 person-years for 1 to 2 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.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.
SizeLarge: 108,274 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Add a CI workflow that builds and runs the test suite on every push/PR.
Raises the score by about 14.9 points · Medium effort · CI/CD gates
2
Run what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Raises the score by about 14.9 points · Medium effort · Security & performance tooling
3
Resolve the 1 `getContentURIForPath` spells `URI` where 23 names in the project spell… finding(s) in Naming Consistency — start with MusicUtils.java.
Raises the score by about 2.8 points · Low effort · Naming Consistency

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 €100,000 to build again, about 0.7 person-years of work. Its weakest lens is Production Readiness, at 24.3 (checked 3 of 8). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Add a CI workflow that builds and runs the test suite on every push/PR. Of all the actions in this report, it raises the score most for the work it takes: about 14.9 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 5.7 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 1,081,797 lines over the last 90 days, which is about 4,387,288 lines a year. At that pace, the extra work comes to an estimated 623.4 to 3740.6 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

58 modules, with 57 dependencies between them. 6 loops run through 12 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 com.android.calculator2.viewpager2 com.android.calendarcommon23 com.android.colorpicker4 com.android.common5 com.android.common.widget6 com.android.datetimepicker7 com.android.datetimepicker.accessibility8 com.android.deskclock.provider9 com.android.deskclock.viewpager10 com.android.deskclock.widget11 com.android.deskclock.widget.multiwaveview12 com.android.deskclock.widget.sgv13 com.android.deskclock.worldclock14 com.android.timezonepicker15 com.android.alarmclock16 com.android.calculator217 com.android.common.contacts18 com.android.datetimepicker.date19 com.android.datetimepicker.time20 com.android.deskclock.alarms21 com.android.deskclock.timer22 com.android.ex.chips.recipientchip23 org.candyos.experience.updates24 org.candyos.notes.MainActivity25 org.candyos.reminders.MainActivity26 com.android.calendar.recurrencepicker27 com.android.deskclock28 com.android.ex.chips29 org.candyos.experience.updates.UpdateEngine30 org.candyos.notes31 org.candyos.reminders32 com.android.calendar.event33 com.android.deskclock.stopwatch34 org.candyos.experience35 org.candyos.experience.updates.UpdateEngine.Result36 com.android.calendar37 com.android.calendar.agenda38 com.android.calendar.alerts39 com.android.calendar.month40 com.android.calendar.selectcalendars
1 com.android.calculator2.viewpager
2 com.android.calendarcommon2
3 com.android.colorpicker
4 com.android.common
5 com.android.common.widget
6 com.android.datetimepicker
7 com.android.datetimepicker.accessibility
8 com.android.deskclock.provider
9 com.android.deskclock.viewpager
10 com.android.deskclock.widget
11 com.android.deskclock.widget.multiwaveview
12 com.android.deskclock.widget.sgv
13 com.android.deskclock.worldclock
14 com.android.timezonepicker
15 com.android.alarmclock2
16 com.android.calculator25
17 com.android.common.contacts2
18 com.android.datetimepicker.date11
19 com.android.datetimepicker.time2
20 com.android.deskclock.alarms52
21 com.android.deskclock.timer23
22 com.android.ex.chips.recipientchip4
23 org.candyos.experience.updates1
24 org.candyos.notes.MainActivity1
25 org.candyos.reminders.MainActivity1
26 com.android.calendar.recurrencepicker12
27 com.android.deskclock1243234
28 com.android.ex.chips5
29 org.candyos.experience.updates.UpdateEngine1
30 org.candyos.notes1
31 org.candyos.reminders1
32 com.android.calendar.event2233331219
33 com.android.deskclock.stopwatch13
34 org.candyos.experience1
35 org.candyos.experience.updates.UpdateEngine.Result33
36 com.android.calendar1313125
37 com.android.calendar.agenda8
38 com.android.calendar.alerts1
39 com.android.calendar.month16
40 com.android.calendar.selectcalendars12
Uses a module listed above itPart of a loopThe module itself
1 com.android.calculator2.viewpager2 com.android.calendarcommon23 com.android.colorpicker4 com.android.common5 com.android.common.widget6 com.android.datetimepicker7 com.android.datetimepicker.accessibility8 com.android.deskclock.provider9 com.android.deskclock.viewpager10 com.android.deskclock.widget11 com.android.deskclock.widget.multiwaveview12 com.android.deskclock.widget.sgv13 com.android.deskclock.worldclock14 com.android.timezonepicker15 com.android.alarmclock16 com.android.calculator217 com.android.common.contacts18 com.android.datetimepicker.date19 com.android.datetimepicker.time20 com.android.deskclock.alarms21 com.android.deskclock.timer22 com.android.ex.chips.recipientchip23 org.candyos.experience.updates24 org.candyos.notes.MainActivity25 org.candyos.reminders.MainActivity26 com.android.calendar.recurrencepicker27 com.android.deskclock28 com.android.ex.chips29 org.candyos.experience.updates.UpdateEngine30 org.candyos.notes31 org.candyos.reminders32 com.android.calendar.event33 com.android.deskclock.stopwatch34 org.candyos.experience35 org.candyos.experience.updates.UpdateEngine.Result36 com.android.calendar37 com.android.calendar.agenda38 com.android.calendar.alerts39 com.android.calendar.month40 com.android.calendar.selectcalendarscom.android.calculator2.viewpager1com.android.calendarcommon22com.android.colorpicker3com.android.common4com.android.common.widget5com.android.datetimepicker6com.android.datetimepicker.accessibility7com.android.deskclock.provider8com.android.deskclock.viewpager9com.android.deskclock.widget10com.android.deskclock.widget.multiwaveview11com.android.deskclock.widget.sgv12com.android.deskclock.worldclock13com.android.timezonepicker14com.android.alarmclock15com.android.calculator216com.android.common.contacts17com.android.datetimepicker.date18com.android.datetimepicker.time19com.android.deskclock.alarms20com.android.deskclock.timer21com.android.ex.chips.recipientchip22org.candyos.experience.updates23org.candyos.notes.MainActivity24org.candyos.reminders.MainActivity25com.android.calendar.recurrencepicker26com.android.deskclock27com.android.ex.chips28org.candyos.experience.updates.UpdateEngine29org.candyos.notes30org.candyos.reminders31com.android.calendar.event32com.android.deskclock.stopwatch33org.candyos.experience34org.candyos.experience.updates.UpdateEngine.Result35com.android.calendar36com.android.calendar.agenda37com.android.calendar.alerts38com.android.calendar.month39com.android.calendar.selectcalendars402521125223411112124323451112233331219131331313125811612+18 more modules (most-connected shown)

At a glance — Code Health · 54.5 · Adequate · gated by D2, X5 ·

At a glance — Architecture · 99.4 · Exemplary ·

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

At a glance — Readiness · 24.3 · Checked 3 of 8 · gated by P1, P3 ·

At a glance — Security · 70.6 · Checked 2 of 9 ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection17Medium

Roadmap

Top priorities: Add a CI workflow that builds and runs the test suite on every push/PR; Run what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing; Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).

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

Do thisHelpsEffortDimension
Add a CI workflow that builds and runs the test suite on every push/PR.+14.9 ptsMediumCI/CD gates
Run what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.+14.9 ptsMediumSecurity & performance tooling
Resolve the 1 `getContentURIForPath` spells `URI` where 23 names in the project spell… finding(s) in Naming Consistency — start with MusicUtils.java.+2.8 ptsLowNaming Consistency
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).+4.1 ptsMediumNullable reference types
Resolve the 17 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (17).+2.3 ptsMediumStatic Analysis (SAST)
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.+2.1 ptsMediumArchitecture documentation
Swallowed exception (empty catch)+0.9 ptsMediumException handling
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.+0.7 ptsMediumDocumentation (README)

File quality

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

FileScoreBandWorst signal
apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java5.5MixedCognitive Complexity: ScrollStateRunnable.run (cognitive 17)
REDACTED5.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.9MixedStatic Analysis (SAST): Medium: REDACTED
apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java6.0MixedExplicit Debt: XxxComment
apps/Calendar/src/com/android/calendar/DayView.java6.0MixedExplicit Debt: TodoComment
apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java6.0MixedExplicit Debt: TodoComment
apps/Calendar/src/com/android/calendar/CalendarController.java6.0MixedExplicit Debt: TodoComment
apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java6.0MixedExplicit Debt: TodoComment
apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java6.0MixedExplicit Debt: TodoComment
apps/Calendar/src/com/android/calendar/CalendarEventModel.java6.0MixedExplicit Debt: TodoComment
apps/Calendar/src/com/android/calendar/event/EditEventHelper.java6.0MixedExplicit Debt: TodoComment
apps/Calendar/src/com/android/calendar/alerts/AlertService.java6.0MixedExplicit Debt: TodoComment
apps/Calendar/src/com/android/calendar/AllInOneActivity.java6.0MixedExplicit Debt: TodoComment
apps/Calendar/src/com/android/calendar/Utils.java6.0MixedExplicit Debt: TodoComment
apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java6.0MixedExplicit Debt: TodoComment
apps/Music/src/com/android/music/MediaPlaybackService.java6.0MixedExplicit Debt: FixmeComment
apps/Calendar/src/com/android/calendar/EventInfoFragment.java6.0MixedExplicit Debt: TodoComment
apps/Calendar/src/com/android/calendar/event/EditEventFragment.java6.0MixedExplicit Debt: TodoComment
apps/Calendar/src/com/android/timezonepicker/TimeZoneData.java6.0MixedExplicit Debt: TodoComment
apps/DeskClock/src/com/android/deskclock/timer/CountingTimerView.java6.0MixedExplicit Debt: TodoComment

How the grades work

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

Critical — 0

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

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

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

Could not be resolved — 24

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 35 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.7, 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 — 35 dimensions across the health lenses
D1D2D3D4D6D13D15D17D21D27D28D29D35AX10AX6GD1IC1M1M2M3M4P1P3X16X18X19X20X21X25X27X28X29X3X30X5

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

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1e7f6-006c-7732-b2e1-18a5ac7f7405.

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

Run transparency — what happened this run

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

  • D5 Coupling — 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.
  • 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 (.java) 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 (.java) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. 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. No dependency manifest this pass reads for hygiene (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems)) was found in this repository, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D30 wherever the manifest is OSV-readable.
  • D14 License Compliance — 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 — no dependency manifest this pass reads for licence data (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems)) was found in this repository, so it declares no third-party dependency closure to grade. A gap in the analyzer, NOT a finding that this repository's licences are compliant: a manifest in an ecosystem outside that list, or third-party code copied into the tree, is not read — so this dimension asserts nothing about this repository's licensing in either direction.
  • D20 ADR Quality — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The ADR expectation is gated on whether a repository ships a deployable product. Our repo-kind classifier reads .NET project files and the host and package markers of the other ecosystems it knows (a Go `package main`, a Cargo binary, a package.json `bin`, `start` script or application dev server such as Vite or Next, Python console scripts or a Django/WSGI entry point, a Spring Boot / WAR / Gradle application build, a Rack or Rails app, a Composer project, an OTP release or escript, a Dockerfile, a Procfile, a Platform.sh `.platform/routes.yaml`, and the corresponding published-package manifests, including an OTP `*.app.src`, a Drupal module's `*.info` and a Claude Code `.claude-plugin/plugin.json`), and found none here, so we could not tell what kind of repository this is and did not assess its ADR log. This is a gap in our analyzer, not a finding about this repository. No manifest, project file or entry point of any ecosystem it reads exists in this tree.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — 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. This repository's source is written only in languages whose packages are published through a manifest, and no manifest in the tree makes a publication act: either there is no package manifest of any ecosystem (no package.json, pyproject.toml, setup.py, gemspec, Cargo.toml, pom.xml, build.gradle, composer.json, pubspec.yaml or mix.exs), or every one present declares in its package manager's own terms that it is not published (an npm package marked "private": true, a Cargo package with publish = false, a pubspec with publish_to: none, a Composer "project", a Poetry project with package-mode = false, or the "Private :: Do Not Upload" classifier). With no publication act there is no intentionally-exposed surface for API consistency to be judged over.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `(repository root)` (108274 LoC, 430 module-visible types across 49 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `apps/CandyExperience/src/org/candyos/experience/Configs.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.
  • D34 Knowledge Freshness — git history too condensed for a reliable signal — The history looks squashed or freshly imported, so per-file ownership reflects those commits rather than real maintenance. This dimension is reported as a low-confidence advisory and is not scored.
  • D44 Platform End-of-Life — 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • AX3 Project dependency cycles — 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 is computed over which project references which. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj/.fsproj/.vbproj, Gradle, Maven, Cargo, npm/pnpm/yarn, Go module (and dep/glide/godep), Python pyproject.toml/setup.cfg/setup.py, SwiftPM, sbt, Mill, RubyGems, Composer, Mix/rebar3, pub, Unity assembly-definition, Deno/JSR, Tuist, CMake, Bazel, Xcode and XcodeGen builds and uni-app uni_modules plugins, or — when none declares a module — from the imports between a JavaScript/TypeScript, Python, Ruby, loose Rust, build-less C# or manifest-less Go tree's top-level directories, or as one module when all of a tree's source is one directory, and this repository offers none of them — so there was no graph to read, and re-running the same commit reads the same nothing. No module manifest of any ecosystem this engine recognises was found either, and the source's own imports could not stand in: they are read for JavaScript/TypeScript, Python and Ruby only, and only when those languages are the product — in any other language a tree is read only when its whole source is one directory, which this one's is not. The collector owed is an import reader for this repository's languages. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and not a finding that the repository is free of what this check looks for.
  • AX4 Dependency direction — 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 is computed over the direction each project reference points. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj/.fsproj/.vbproj, Gradle, Maven, Cargo, npm/pnpm/yarn, Go module (and dep/glide/godep), Python pyproject.toml/setup.cfg/setup.py, SwiftPM, sbt, Mill, RubyGems, Composer, Mix/rebar3, pub, Unity assembly-definition, Deno/JSR, Tuist, CMake, Bazel, Xcode and XcodeGen builds and uni-app uni_modules plugins, or — when none declares a module — from the imports between a JavaScript/TypeScript, Python, Ruby, loose Rust, build-less C# or manifest-less Go tree's top-level directories, or as one module when all of a tree's source is one directory, and this repository offers none of them — so there was no graph to read, and re-running the same commit reads the same nothing. No module manifest of any ecosystem this engine recognises was found either, and the source's own imports could not stand in: they are read for JavaScript/TypeScript, Python and Ruby only, and only when those languages are the product — in any other language a tree is read only when its whole source is one directory, which this one's is not. The collector owed is an import reader for this repository's languages. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and not a finding that the repository is free of what this check looks for.
  • AX8 Test isolation — 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 is computed over which projects are test projects, and what they reference. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj/.fsproj/.vbproj, Gradle, Maven, Cargo, npm/pnpm/yarn, Go module (and dep/glide/godep), Python pyproject.toml/setup.cfg/setup.py, SwiftPM, sbt, Mill, RubyGems, Composer, Mix/rebar3, pub, Unity assembly-definition, Deno/JSR, Tuist, CMake, Bazel, Xcode and XcodeGen builds and uni-app uni_modules plugins, or — when none declares a module — from the imports between a JavaScript/TypeScript, Python, Ruby, loose Rust, build-less C# or manifest-less Go tree's top-level directories, or as one module when all of a tree's source is one directory, and this repository offers none of them — so there was no graph to read, and re-running the same commit reads the same nothing. No module manifest of any ecosystem this engine recognises was found either, and the source's own imports could not stand in: they are read for JavaScript/TypeScript, Python and Ruby only, and only when those languages are the product — in any other language a tree is read only when its whole source is one directory, which this one's is not. The collector owed is an import reader for this repository's languages. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and not a finding that the repository is free of what this check looks for.
  • AXB1 Runtime evidence locked — no reproducible boot — 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. Subject: 2 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data 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 personal data controls.
  • C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit 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 audit controls.
  • C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention 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 retention controls.
  • C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights 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 data-subject rights controls.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — 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. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found. Whether there is anything here to recover could NOT be determined: persistence is detected from deployment/container manifests and from dependency manifests, and neither was readable by this pass, so a data store this code opens directly — a file, an embedded database — would not be visible to it. The blindness is this analyzer's, not a finding that the repository holds no data. You can widen what we reach: keep the deployment/container manifest or a dependency manifest in this repository — or a link to the ops repo that holds the DR evidence — so the persistence probe has something to read.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X10 Duplicated predicate — 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. 70 further occurrence(s) are not listed individually; the score already reflects all 110.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • 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.
  • 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.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • 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.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.

Dimensions

D1 · Cyclomatic Complexity6.3 / 10Adequate✓ Tool-verified

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

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

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

122 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was RecurrenceProcessor.expand at 75.

ViewPager.populate (cyclomatic 59) · ×2apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:913
RadialPickerLayout.onTouch (cyclomatic 31) · ×2apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:566
ViewPager.onInterceptTouchEvent (cyclomatic 29) · ×2apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1776
ViewPager.onTouchEvent (cyclomatic 24) · ×2apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1920
ViewPager.calculatePageOffsets (cyclomatic 23) · ×2apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1117

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

What to do

  1. Bring the 2 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with RecurrenceProcessor.expand (cyclomatic 75), DayView.computeNeighbors (cyclomatic 65). — 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 6.3 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D2 · Cognitive Complexity2.6 / 10Weak✓ Tool-verified

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

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

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

258 method(s) exceeded the cognitive complexity threshold of 15; the worst was RecurrenceProcessor.expand at 234.

ViewPager.populate (cognitive 142) · ×2apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:913
RadialPickerLayout.onTouch (cognitive 61) · ×2apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:566
ViewPager.onInterceptTouchEvent (cognitive 50) · ×2apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1776
ViewPager.onMeasure (cognitive 47) · ×2apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1359
ViewPager.calculatePageOffsets (cognitive 43) · ×2apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1117

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

What to do

  1. Bring the 4 bodies over 120 down to 120 or less in Cognitive Complexity — start with RecurrenceProcessor.expand (cognitive 234), DayView.computeNeighbors (cognitive 154), ViewPager.populate (cognitive 142). — 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 4 together lifts Cognitive Complexity from 2.6 to about 3.9/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

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

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

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

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

121 god class(es) detected.

ClassTooLong: DayView · ×37apps/Calendar/src/com/android/calendar/DayView.java:94
FileTooLong: calendar/DayView.java · ×33apps/Calendar/src/com/android/calendar/DayView.java
MethodTooLong: RecurrenceProcessor.expand · ×27apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:735
TooManyMethods: RecipientEditTextView · ×24apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:109

What to do

  1. Resolve the 37 ClassTooLong finding(s) in God Classes — start with ViewPager.java (2), TimePickerDialog.java (2), RadialPickerLayout.java (2). — One of this dimension's main actionable groups (37 warning-level).
  2. Resolve the 33 FileTooLong finding(s) in God Classes — start with ViewPager.java (2), TimePickerDialog.java (2), DayView.java. — One of this dimension's main actionable groups (33 warning-level).
  3. Resolve the 27 MethodTooLong finding(s) in God Classes — start with DayView.java (3), EditEventView.java (2), EventInfoFragment.java (2). — One of this dimension's main actionable groups (27 warning-level).

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

D4 · Code Duplication4.3 / 10Weak✓ Tool-verified

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

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

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

311 duplicated block group(s) detected. 14.2 % of the production lines (15,409 of 108,274) are in a reported copy. A further 110 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (10 lines × 2) · ×28apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2760
Duplicated block (7 lines × 2) · ×26apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2877
Duplicated block (8 lines × 2) · ×21apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:793
Duplicated block (9 lines × 2) · ×18apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:450
Duplicated block (11 lines × 2) · ×15apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:826

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

What to do

  1. Resolve the 28 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with ViewPager.java (3), ExploreByTouchHelper.java (3), DatePickerDialog.java (3). — One of this dimension's main actionable groups (28 warning-level).
  2. Resolve the 26 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with SimpleMonthView.java (5), ViewPager.java (4), YearPickerView.java (3). — One of this dimension's main actionable groups (26 warning-level).
  3. Resolve the 21 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with TextViewWithCircularIndicator.java (4), AlbumBrowserActivity.java (2), ViewPager.java (2). — One of this dimension's main actionable groups (21 warning-level).

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

D6 · Cohesion (LCOM4)9.7 / 10Stronggated by 5 serious findings✓ Tool-verified

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

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

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

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

5 of 213 classes have LCOM4 above 3.

Low cohesion: CalculatorDisplay (LCOM4 6) · ×5apps/Calculator/src/com/android/calculator2/CalculatorDisplay.java:33

What to do

  1. Resolve the 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with DayPickerView.java (2), CalculatorDisplay.java, BaseEmailAddressAdapter.java. — One of this dimension's main actionable groups (5 warning-level).

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D17 · Explicit Debt9.6 / 10Stronggated by 207 serious findings✓ Tool-verified

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

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

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

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

TodoComment · ×202apps/SoundRecorder/src/com/android/soundrecorder/SoundRecorder.java:921
HackComment · ×2apps/Music/src/com/android/music/TouchInterceptor.java:211
XxxComment · ×2apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:830
FixmeCommentapps/Music/src/com/android/music/MediaPlaybackService.java:857

What to do

  1. Resolve the 202 TodoComment finding(s) in Explicit Debt — start with StaggeredGridView.java (16), AlertService.java (10), EditEventView.java (9). — One of this dimension's main actionable groups (202 warning-level).
  2. Resolve the 2 HackComment finding(s) in Explicit Debt — start with TouchInterceptor.java, CalculatorEditText.java. — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 2 XxxComment finding(s) in Explicit Debt — start with RecurrenceProcessor.java (2). — One of this dimension's main actionable groups (2 warning-level).

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

D21 · Naming Consistency5.8 / 10Adequate✓ Tool-verified

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

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

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

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

`getContentURIForPath` spells `URI` where 23 names in the project spell it `Uri`apps/Music/src/com/android/music/MusicUtils.java:736

What to do

  1. Resolve the 1 `getContentURIForPath` spells `URI` where 23 names in the project spell… finding(s) in Naming Consistency — start with MusicUtils.java. — 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.

D27 · Navigability9.9 / 10Exemplary✓ Tool-verified

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

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

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

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

13 % of calls cross a namespace and 3 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)4.1 / 10Weak✓ Tool-verified

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

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

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

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

17 finding(s): 0 critical, 0 high, 17 medium, 0 low.

REDACTED

What to do

  1. Resolve the 17 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (17). — One of this dimension's main actionable groups (17 warning-level).

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

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

Frontend & cross-cutting dimensions

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

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

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

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

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

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

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

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

GD1 · Unfinished & placeholder code10.0 / 10Exemplary✓ Tool-verified

Other · Code Health — Unreviewed-generation residue in this repository's Java: methods whose whole body only throws a "not implemented" or bare unsupported-operation exception, or returns a default value (or nothing) under a TODO/FIXME marker, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

  • `eventsChanged` is a shipped method whose body is empty except for a TODO/FIXME — scaffolding that was never completed. Implement it or remove it. — apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:929

What to do

  • Finish or delete the methods that still throw "not implemented" or return a placeholder under a TODO, and replace placeholder text before shipping.
IC1 · Incompleteness & stubs7.8 / 10Strong✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Java: methods that only throw a "not implemented" exception, methods that take inputs and return a constant or do nothing, dead `if (false)` branches, and skeleton classes most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition. (×5) — apps/Calendar/src/com/android/calendarcommon2/ICalendar.java:451, apps/Calendar/src/com/android/calendarcommon2/RecurrenceSet.java:222, apps/Calendar/src/com/android/calendarcommon2/RecurrenceSet.java:236, …

What to do

  • Remove the dead code that looks live: delete dead if(false) branches, which read as logic that runs, and the skeleton classes nobody finished.
M1 · Documentation (README)7.3 / 10Strong✓ Tool-verified

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

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

What to do

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

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

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

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

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.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified

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

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

  • No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.

What to do

  • Add a CI workflow that builds and runs the test suite on every push/PR.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

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

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

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

What to do

  • Run what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

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

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

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements (or a repository exception type deriving from it) controlled by an `if` — directly or through the `using`, `lock` or `try` that wraps the throw — whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`); in the `else` branch, for a conjunct of the admitting condition that is FALSE of a non-null `p`. Range guards are read for bounds that leave nothing and for a `p > C.Count` bound whose index then reaches `C[p]`, `C.RemoveAt(p)` or a method of the same type that indexes with it. Deterministic, provable per finding. Advisory.

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

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

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

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

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

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

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

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

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

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

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

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

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling7.6 / 10Strong✓ Tool-verified

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

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

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×3) — apps/Music/src/com/android/music/MediaPlaybackService.java:1586, apps/Music/src/com/android/music/TrackBrowserActivity.java:433, apps/Calendar/src/com/android/calendar/alerts/AlertService.java:214

What to do

  • Swallowed exception (empty catch)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether Java packages are null-marked and not undermined by heavy nullness suppression — a package under `@NullMarked` (or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, or a NullAway/Checker Framework configuration naming it) makes an unannotated reference exclude null, and `@SuppressWarnings("NullAway")`, `("nullness")`, `("null")` and `castToNonNull(…)` are what silence it.

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

  • 0/44 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.

What to do

  • Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).

Reference — by lens

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

LensScoreRatingImpact
Code Health54.5Adequate — gated by D2, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture99.4ExemplaryStrongest area.
Maturity67.1Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness24.3Checked 3 of 8Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security70.6Checked 2 of 9Solid.
Unscored — 1 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 6 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Not assessed: these audit 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 audit 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.
  • C4 Data Retention — Not assessed: these retention 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 retention 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.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights 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 data-subject rights 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.
  • P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
  • P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
Not included — 73 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 — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC2 Forms & labels — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC3 Page structure — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC4 Keyboard semantics — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC5 ARIA correctness — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC6 Visual & motion safety — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • AX1 Captive dependencies — Not applicable: this repository's Java imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Kotlin imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads.
  • AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository commits no project file of a kind this check models. This is a gap in the analyzer, not a finding about this repository
  • AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository commits no project file of a kind this check models. This is a gap in the analyzer, not a finding about this repository
  • 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 — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) that was not loaded for this repository, because the repository commits no project file of a kind this check models. This is a gap in the analyzer, not a finding about this repository
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data 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 personal data 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.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~4621 lines of test source are present (.java) 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 — no .java test runner
  • D12 Dependency Hygiene — Dependency hygiene not measured — no supported dependency manifest was read
  • D14 License Compliance — No dependency manifest found — no declared dependency closure to grade for licences
  • D16 Bus Factor — bus factor 1 — one contributor carries this repository
  • 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.
  • D19 Documentation Quality — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
  • D20 ADR Quality — Repository kind not determined
  • D22 Internal API Consistency — No intentionally-exposed public API to evaluate for consistency.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .java, .kt, .py, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems) — 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) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D34 Knowledge Freshness — history too condensed to judge knowledge freshness
  • D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems) — not scanned yet).
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • D5 Coupling — D5 reads a .NET project-reference graph only — this repository's production source is .java, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 12 value object(s); 1 domain event(s); its domain events are published by services or handlers — no domain entity raises 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
  • P12 CI test-gate honesty — no CI workflow found
  • P2 Observability — This repository's JVM source (1 module(s), 330 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service — it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@Benchmark` in a Java, Kotlin or Scala file importing JMH or kotlinx-benchmark, Jetpack Benchmark's `measureRepeated` in a file importing androidx.benchmark, or JMH/kotlinx-benchmark/androidx.benchmark in a pom.xml, Gradle or sbt build, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X12 Unreachable branch — X12 reached only 2% of this repository's production lines — java (105,634 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Java was read, and it logs through none that an assembled message defeats: java.util.logging's level methods, log4j 1, commons-logging, JBoss Logging and Flogger take one finished message (as log4net does in C#), or it makes no call through a named logger at all. Calls made through SLF4J or log4j 2 (`org.slf4j.Logger`, `org.apache.logging.log4j.Logger`, Lombok's `@Slf4j`) would be judged.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Serious — 1162 finding(s)
D17 · Explicit Debt · TodoComment · ×202
  • TodoComment apps/SoundRecorder/src/com/android/soundrecorder/SoundRecorder.java:921 — // TODO: update error message to reflect that the recording could not be — 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 apps/Music/src/com/android/music/AudioPreview.java:374 — // TODO: if mMediaId != -1, then the playing file has an entry in the media — 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 apps/Music/src/com/android/music/MediaPlaybackService.java:1357 — // TODO: make it work right after adding/removing items in the queue. — 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 apps/Music/src/com/android/music/MediaPlaybackService.java:1918 — // TODO: notify the user why the file couldn't be opened — 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 apps/Music/src/com/android/music/MediaPlaybackService.java:1921 — // TODO: notify the user why the file couldn't be opened — 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 apps/Music/src/com/android/music/PlaylistBrowserActivity.java:420 — // Todo: show a message — 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 apps/Music/src/com/android/music/PlaylistBrowserActivity.java:445 — // Todo: show a message — 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 apps/Music/src/com/android/music/TrackBrowserActivity.java:1501 — // TODO: IPC call on each bind?? — 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 apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:805 — // TODO temporary hack to prevent the convertView from not having stuff we need. — 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 apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1490 — // TODO we may have to deal with cancelations of the animation. — 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 apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1599 — // TODO we may have to deal with cancelations of the animation. — 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 apps/DeskClock/src/com/android/deskclock/LabelDialogFragment.java:138 — // TODO just pass in a listener in newInstance() — 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 apps/DeskClock/src/com/android/deskclock/LabelDialogFragment.java:150 — // TODO just pass in a listener in newInstance() — 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 apps/DeskClock/src/com/android/deskclock/TimerRingService.java:110 — // TODO: Reuse mMediaPlayer instead of creating a new one and/or use — 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 apps/DeskClock/src/com/android/deskclock/widget/EllipsizeLayout.java:87 — // TODO: support multiple android:ellipsize — 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 apps/DeskClock/src/com/android/deskclock/widget/EllipsizeLayout.java:113 — // TODO: Respect android:minWidth (easy with @TargetApi(16)) — 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 apps/DeskClock/src/com/android/deskclock/widget/sgv/GridAdapter.java:119 — // TODO: Rather than using Object, use BaseNode so that we're not confused between this — 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 apps/DeskClock/src/com/android/deskclock/widget/sgv/OverScrollerSGV.java:700 — // TODO: restore when WebView uses the fast fling implemented in this class. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment apps/DeskClock/src/com/android/deskclock/widget/sgv/OverScrollerSGV.java:743 — // TODO take velocity into account — 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 apps/DeskClock/src/com/android/deskclock/widget/sgv/OverScrollerSGV.java:834 — // TODO: figure out how to absorb the velocity properly. — 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 apps/DeskClock/src/com/android/deskclock/widget/sgv/OverScrollerSGV.java:879 — // TODO Better compute speed when edge was reached — 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 apps/DeskClock/src/com/android/deskclock/widget/sgv/ReorderHelper.java:200 — // TODO: Consolidate clearDraggedChild() and clearDraggedChildId(). — 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 apps/DeskClock/src/com/android/deskclock/widget/sgv/ReorderHelper.java:244 — // TODO: If we've dragged off the screen, return null for now until we know what — 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 apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:551 — // TODO: If we've dragged off the screen, return null for now until we know what — 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 apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:225 — // TODO: Put these states into a ReorderingParam object for maintainability. — 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.
  • + 177 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×37
  • ClassTooLong: DayView apps/Calendar/src/com/android/calendar/DayView.java:94 — ClassTooLong — 3108 significant lines (blank, comment-only and punctuation-only lines excluded), 110 methods. The bar is 400 significant lines; this is 2708 over it, 7.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: StaggeredGridView apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:78 — ClassTooLong — 2011 significant lines (blank, comment-only and punctuation-only lines excluded), 103 methods. The bar is 400 significant lines; this is 1611 over it, 5.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ViewPager apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:80 — ClassTooLong — 1661 significant lines (blank, comment-only and punctuation-only lines excluded), 87 methods. The bar is 400 significant lines; this is 1261 over it, 4.15× 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: ViewPager apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:80 — ClassTooLong — 1659 significant lines (blank, comment-only and punctuation-only lines excluded), 87 methods. The bar is 400 significant lines; this is 1259 over it, 4.15× 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: RecipientEditTextView apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:109 — ClassTooLong — 1655 significant lines (blank, comment-only and punctuation-only lines excluded), 124 methods. The bar is 400 significant lines; this is 1255 over it, 4.14× 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: EventInfoFragment apps/Calendar/src/com/android/calendar/EventInfoFragment.java:117 — ClassTooLong — 1421 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 400 significant lines; this is 1021 over it, 3.55× 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: MediaPlaybackService apps/Music/src/com/android/music/MediaPlaybackService.java:69 — ClassTooLong — 1315 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 915 over it, 3.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: EditEventView apps/Calendar/src/com/android/calendar/event/EditEventView.java:105 — ClassTooLong — 1116 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 716 over it, 2.79× 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: AlarmClockFragment apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:84 — ClassTooLong — 1059 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 659 over it, 2.65× 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: TrackBrowserActivity apps/Music/src/com/android/music/TrackBrowserActivity.java:68 — ClassTooLong — 1016 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 616 over it, 2.54× 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: Utils apps/Calendar/src/com/android/calendar/Utils.java:75 — ClassTooLong — 994 significant lines (blank, comment-only and punctuation-only lines excluded), 82 methods. The bar is 400 significant lines; this is 594 over it, 2.49× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MediaPlaybackActivity apps/Music/src/com/android/music/MediaPlaybackActivity.java:69 — ClassTooLong — 913 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 513 over it, 2.28× 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: AllInOneActivity apps/Calendar/src/com/android/calendar/AllInOneActivity.java:85 — ClassTooLong — 871 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 471 over it, 2.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AgendaWindowAdapter apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java:76 — ClassTooLong — 864 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 464 over it, 2.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MusicUtils apps/Music/src/com/android/music/MusicUtils.java:72 — ClassTooLong — 827 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods. The bar is 400 significant lines; this is 427 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GlowPadView apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:56 — ClassTooLong — 800 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods. The bar is 400 significant lines; this is 400 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: EditEventHelper apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:58 — ClassTooLong — 794 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 394 over it, 1.99× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RecurrencePickerDialog apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:67 — ClassTooLong — 770 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 370 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.
  • ClassTooLong: MonthWeekEventsView apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:56 — ClassTooLong — 733 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 333 over it, 1.83× 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: TimerFragment apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:66 — ClassTooLong — 682 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 282 over it, 1.71× 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: StopwatchFragment apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:46 — ClassTooLong — 663 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 263 over it, 1.66× 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: RecurrenceProcessor apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:27 — ClassTooLong — 655 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 255 over it, 1.64× 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: AlertService apps/Calendar/src/com/android/calendar/alerts/AlertService.java:58 — ClassTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 225 over it, 1.56× 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: EditEventFragment apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:73 — ClassTooLong — 619 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 219 over it, 1.55× 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: TimePickerDialog apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:53 — ClassTooLong — 598 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 198 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 12 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×33
  • FileTooLong: calendar/DayView.java apps/Calendar/src/com/android/calendar/DayView.java — FileTooLong — 3178 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: DayView (94-5038). The bar is 500 significant lines; this is 2678 over it, 6.36× 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: sgv/StaggeredGridView.java apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java — FileTooLong — 2052 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: StaggeredGridView (78-4145). The bar is 500 significant lines; this is 1552 over it, 4.10× 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: chips/RecipientEditTextView.java apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java — FileTooLong — 1737 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: RecipientEditTextView (109-2892). The bar is 500 significant lines; this is 1237 over it, 3.47× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: viewpager/ViewPager.java apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java — FileTooLong — 1695 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: ViewPager (80-2885). The bar is 500 significant lines; this is 1195 over it, 3.39× 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: viewpager/ViewPager.java apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java — FileTooLong — 1693 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: ViewPager (80-2885). The bar is 500 significant lines; this is 1193 over it, 3.39× 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: calendar/EventInfoFragment.java apps/Calendar/src/com/android/calendar/EventInfoFragment.java — FileTooLong — 1516 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: EventInfoFragment (117-2298). The bar is 500 significant lines; this is 1016 over it, 3.03× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: music/MediaPlaybackService.java apps/Music/src/com/android/music/MediaPlaybackService.java — FileTooLong — 1360 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: MediaPlaybackService (69-2222). The bar is 500 significant lines; this is 860 over it, 2.72× 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: event/EditEventView.java apps/Calendar/src/com/android/calendar/event/EditEventView.java — FileTooLong — 1200 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: EditEventView (105-1852). The bar is 500 significant lines; this is 700 over it, 2.40× 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: deskclock/AlarmClockFragment.java apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java — FileTooLong — 1119 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: AlarmClockFragment (84-1815). The bar is 500 significant lines; this is 619 over it, 2.24× 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: music/TrackBrowserActivity.java apps/Music/src/com/android/music/TrackBrowserActivity.java — FileTooLong — 1063 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: TrackBrowserActivity (68-1580). The bar is 500 significant lines; this is 563 over it, 2.13× 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: calendar/Utils.java apps/Calendar/src/com/android/calendar/Utils.java — FileTooLong — 1047 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: Utils (75-2126). The bar is 500 significant lines; this is 547 over it, 2.09× 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: music/MediaPlaybackActivity.java apps/Music/src/com/android/music/MediaPlaybackActivity.java — FileTooLong — 961 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: MediaPlaybackActivity (69-1390). The bar is 500 significant lines; this is 461 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: calendar/AllInOneActivity.java apps/Calendar/src/com/android/calendar/AllInOneActivity.java — FileTooLong — 934 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: AllInOneActivity (85-1327). The bar is 500 significant lines; this is 434 over it, 1.87× 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: agenda/AgendaWindowAdapter.java apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java — FileTooLong — 901 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: AgendaWindowAdapter (76-1412). The bar is 500 significant lines; this is 401 over it, 1.80× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: music/MusicUtils.java apps/Music/src/com/android/music/MusicUtils.java — FileTooLong — 879 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: MusicUtils (72-1364). The bar is 500 significant lines; this is 379 over it, 1.76× 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: event/EditEventHelper.java apps/Calendar/src/com/android/calendar/event/EditEventHelper.java — FileTooLong — 831 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: EditEventHelper (58-1390). The bar is 500 significant lines; this is 331 over it, 1.66× 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: multiwaveview/GlowPadView.java apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java — FileTooLong — 827 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: GlowPadView (56-1261). The bar is 500 significant lines; this is 327 over it, 1.65× 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: recurrencepicker/RecurrencePickerDialog.java apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java — FileTooLong — 816 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: RecurrencePickerDialog (67-1322). The bar is 500 significant lines; this is 316 over it, 1.63× 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: month/MonthWeekEventsView.java apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java — FileTooLong — 768 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: MonthWeekEventsView (56-1110). The bar is 500 significant lines; this is 268 over it, 1.54× 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: timer/TimerFragment.java apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java — FileTooLong — 726 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: TimerFragment (66-1059). The bar is 500 significant lines; this is 226 over it, 1.45× 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: stopwatch/StopwatchFragment.java apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java — FileTooLong — 704 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: StopwatchFragment (46-1050). The bar is 500 significant lines; this is 204 over it, 1.41× 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: event/EditEventFragment.java apps/Calendar/src/com/android/calendar/event/EditEventFragment.java — FileTooLong — 671 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: EditEventFragment (73-990). The bar is 500 significant lines; this is 171 over it, 1.34× 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: calendarcommon2/RecurrenceProcessor.java apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java — FileTooLong — 660 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: RecurrenceProcessor (27-1318). The bar is 500 significant lines; this is 160 over it, 1.32× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: alerts/AlertService.java apps/Calendar/src/com/android/calendar/alerts/AlertService.java — FileTooLong — 659 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: AlertService (58-1132). The bar is 500 significant lines; this is 159 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: time/TimePickerDialog.java apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java — FileTooLong — 626 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: TimePickerDialog (53-988). The bar is 500 significant lines; this is 126 over it, 1.25× 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.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×28
  • Duplicated block (10 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2760 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2760-2769 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2760-2769 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2773 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2773-2782 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2773-2782 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/calendar/EventInfoFragment.java:2240 — apps/Calendar/src/com/android/calendar/EventInfoFragment.java:2240-2249 | apps/Calendar/src/com/android/calendar/event/EditEventView.java:945-954 — 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 (10 lines × 2) apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:824 — apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:824-833 | apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:854-863 — 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 `apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:824` 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) apps/Calendar/src/com/android/calendar/event/CreateEventDialogFragment.java:281 — apps/Calendar/src/com/android/calendar/event/CreateEventDialogFragment.java:281-290 | apps/Calendar/src/com/android/calendar/event/EditEventView.java:1498-1507 — 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 `apps/Calendar/src/com/android/calendar/event/CreateEventDialogFragment.java:281` 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) apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:416 — apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:416-425 | apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:442-451 — 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 `apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:416` 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) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:246 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:246-255 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:244-253 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:164 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:164-173 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:162-171 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/ex/chips/RecipientAlternatesAdapter.java:226 — apps/Calendar/src/com/android/ex/chips/RecipientAlternatesAdapter.java:226-235 | apps/Calendar/src/com/android/ex/chips/RecipientAlternatesAdapter.java:427-436 — 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 `apps/Calendar/src/com/android/ex/chips/RecipientAlternatesAdapter.java:226` 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) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2521 — apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2521-2530 | apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2649-2658 — 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 `apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2521` 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) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:3718 — apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:3718-3727 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:3737-3746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) apps/Music/src/com/android/music/MediaPlaybackActivity.java:544 — apps/Music/src/com/android/music/MediaPlaybackActivity.java:544-553 | apps/Music/src/com/android/music/MusicUtils.java:281-290 — 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) apps/Music/src/com/android/music/MusicPicker.java:256 — apps/Music/src/com/android/music/MusicPicker.java:256-265 | apps/Music/src/com/android/music/TrackBrowserActivity.java:1487-1496 — 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 `apps/Music/src/com/android/music/MusicPicker.java:256` 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) apps/Calendar/src/com/android/common/contacts/DataUsageStatUpdater.java:108 — apps/Calendar/src/com/android/common/contacts/DataUsageStatUpdater.java:108-117 | apps/Calendar/src/com/android/common/contacts/DataUsageStatUpdater.java:158-167 — 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 `apps/Calendar/src/com/android/common/contacts/DataUsageStatUpdater.java:108` 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) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1331 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1331-1340 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1331-1340 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:531 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:531-540 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:529-538 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:645 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:645-654 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:643-652 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:359 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:359-368 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:357-366 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:370 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:370-379 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:368-377 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:134 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:134-143 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:132-141 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:650 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:650-659 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:647-656 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:132 — apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:132-141 | apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java:130-139 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:49 — apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:49-58 | apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java:47-56 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/CircleView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 86 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: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:276 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:276-285 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:274-283 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:732 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:732-741 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:730-739 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • + 3 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×27
  • MethodTooLong: RecurrenceProcessor.expand apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:735 — MethodTooLong — expand runs 241 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 141 over it, 2.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DayView.computeNeighbors apps/Calendar/src/com/android/calendar/DayView.java:3151 — MethodTooLong — computeNeighbors runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: EditEventHelper.saveEvent apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:268 — MethodTooLong — saveEvent runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AlarmClockFragment.onCreateView apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:158 — MethodTooLong — onCreateView runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× 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: QueryHandler.onQueryComplete apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java:964 — MethodTooLong — onQueryComplete runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 70 over it, 1.70× 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: AlertService.processQuery apps/Calendar/src/com/android/calendar/alerts/AlertService.java:550 — MethodTooLong — processQuery runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 70 over it, 1.70× 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: QueryHandler.onQueryComplete apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:161 — MethodTooLong — onQueryComplete runs 168 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× 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: RecurrencePickerDialog.onCreateView apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:618 — MethodTooLong — onCreateView runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× 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: EditEventView.<init> apps/Calendar/src/com/android/calendar/event/EditEventView.java:767 — MethodTooLong — <init> runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: QueryHandler.onQueryComplete apps/Calendar/src/com/android/calendar/EventInfoFragment.java:456 — MethodTooLong — onQueryComplete runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× 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: ViewPager.populate apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:913 — MethodTooLong — populate 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: ViewPager.populate apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:913 — MethodTooLong — populate 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: Utils.createDNAStrands apps/Calendar/src/com/android/calendar/Utils.java:924 — MethodTooLong — createDNAStrands runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× 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: MonthWeekEventsView.initView apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:345 — MethodTooLong — initView runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× 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: CalendarController.sendEvent apps/Calendar/src/com/android/calendar/CalendarController.java:432 — MethodTooLong — sendEvent 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: TimePickerDialog.onCreateView apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:193 — MethodTooLong — onCreateView runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TimePickerDialog.onCreateView apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:191 — MethodTooLong — onCreateView runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: EventInfoFragment.onCreateView apps/Calendar/src/com/android/calendar/EventInfoFragment.java:858 — MethodTooLong — onCreateView runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× 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: EditEventView.setModel apps/Calendar/src/com/android/calendar/event/EditEventView.java:1054 — MethodTooLong — setModel 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: StaggeredGridView.layoutChildren apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2218 — MethodTooLong — layoutChildren 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: DayView.<init> apps/Calendar/src/com/android/calendar/DayView.java:652 — MethodTooLong — <init> 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: DayView.onKeyDown apps/Calendar/src/com/android/calendar/DayView.java:1510 — MethodTooLong — onKeyDown runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× 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: RadialPickerLayout.onTouch apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:566 — MethodTooLong — onTouch runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× 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: RadialPickerLayout.onTouch apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:564 — MethodTooLong — onTouch runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× 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: StopwatchFragment.onCreateView apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:284 — MethodTooLong — onCreateView 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×26
  • Duplicated block (7 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2877 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2877-2883 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2877-2883 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) apps/Calendar/src/com/android/calendar/DayView.java:2628 — apps/Calendar/src/com/android/calendar/DayView.java:2628-2634 | apps/Calendar/src/com/android/calendar/DayView.java:2877-2883 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:409 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:409-415 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:406-412 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) apps/DeskClock/src/com/android/alarmclock/DigitalAppWidgetProvider.java:87 — apps/DeskClock/src/com/android/alarmclock/DigitalAppWidgetProvider.java:87-93 | apps/DeskClock/src/com/android/alarmclock/DigitalAppWidgetProvider.java:122-128 — 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 `apps/DeskClock/src/com/android/alarmclock/DigitalAppWidgetProvider.java:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:253 — apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:253-259 | apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:293-299 — 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 `apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) apps/DeskClock/src/com/android/deskclock/timer/TimerObj.java:243 — apps/DeskClock/src/com/android/deskclock/timer/TimerObj.java:243-249 | apps/DeskClock/src/com/android/deskclock/timer/TimerObj.java:263-269 — 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 `apps/DeskClock/src/com/android/deskclock/timer/TimerObj.java:243` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:76 — apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:76-82 | apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java:74-80 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:936 — apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:936-942 | apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:969-975 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:934` calls `setContentDescription`, `getString`, `setImageResource` and `apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:968` 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 (7 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:749 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:749-755 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:749-755 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 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 (7 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2606 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2606-2612 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2608-2614 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2865 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2865-2871 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2865-2871 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 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 (7 lines × 2) apps/Calendar/src/com/android/calendar/month/MonthByWeekAdapter.java:122 — apps/Calendar/src/com/android/calendar/month/MonthByWeekAdapter.java:122-128 | apps/Calendar/src/com/android/calendar/month/SimpleWeeksAdapter.java:165-171 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSyncAdapter.java:220 — apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSyncAdapter.java:220-226 | apps/Calendar/src/com/android/calendar/selectcalendars/SelectSyncedCalendarsMultiAccountAdapter.java:290-296 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:389 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:389-395 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:387-393 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 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 (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:408 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:408-414 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:406-412 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 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 (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:417 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:417-423 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:415-421 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 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 (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:90 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:90-96 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:88-94 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthAdapter.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 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 (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:518 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:518-524 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:515-521 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:541 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:541-547 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:538-544 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:577 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:577-583 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:574-580 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:143 — apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:143-149 | apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java:141-147 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:158 — apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:158-164 | apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java:156-162 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 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 (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:513 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:513-519 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:511-517 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:634 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:634-640 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:632-638 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:568 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:568-574 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:565-571 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 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.
  • + 1 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×24
  • TooManyMethods: RecipientEditTextView apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:109 — TooManyMethods — 124 methods. The bar is 30 methods; this is 94 over it, 4.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DayView apps/Calendar/src/com/android/calendar/DayView.java:94 — TooManyMethods — 110 methods. The bar is 30 methods; this is 80 over it, 3.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: StaggeredGridView apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:78 — TooManyMethods — 103 methods. The bar is 30 methods; this is 73 over it, 3.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ViewPager apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:80 — 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: ViewPager apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:80 — 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: Utils apps/Calendar/src/com/android/calendar/Utils.java:75 — TooManyMethods — 82 methods. The bar is 30 methods; this is 52 over it, 2.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: GlowPadView apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:56 — TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: EventInfoFragment apps/Calendar/src/com/android/calendar/EventInfoFragment.java:117 — 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: MediaPlaybackService apps/Music/src/com/android/music/MediaPlaybackService.java:69 — TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MusicUtils apps/Music/src/com/android/music/MusicUtils.java:72 — 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: AgendaWindowAdapter apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java:76 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: EditEventView apps/Calendar/src/com/android/calendar/event/EditEventView.java:105 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CompositeCursorAdapter apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:32 — 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: BaseRecipientAdapter apps/Calendar/src/com/android/ex/chips/BaseRecipientAdapter.java:64 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CalendarController apps/Calendar/src/com/android/calendar/CalendarController.java:53 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AllInOneActivity apps/Calendar/src/com/android/calendar/AllInOneActivity.java:85 — 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: OverScrollerSGV apps/DeskClock/src/com/android/deskclock/widget/sgv/OverScrollerSGV.java:35 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MediaPlaybackActivity apps/Music/src/com/android/music/MediaPlaybackActivity.java:69 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ServiceStub apps/Music/src/com/android/music/MediaPlaybackService.java:2104 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ExploreByTouchHelper apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:53 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TimePickerDialog apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:53 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ExploreByTouchHelper apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:51 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TimePickerDialog apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:51 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TimerFragment apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:66 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×21
  • Duplicated block (8 lines × 2) apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:793 — apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:793-800 | apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:809-816 — 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 `apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:793` 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) apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:50 — apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:50-57 | apps/DeskClock/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:48-55 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java` and `apps/DeskClock/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java` 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:74 — apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:74-81 | apps/DeskClock/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:72-79 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java` and `apps/DeskClock/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java` 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) apps/DeskClock/src/com/android/deskclock/Screensaver.java:153 — apps/DeskClock/src/com/android/deskclock/Screensaver.java:153-160 | apps/DeskClock/src/com/android/deskclock/ScreensaverActivity.java:191-198 — 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 after the matched lines, `apps/DeskClock/src/com/android/deskclock/ScreensaverActivity.java:199` calls `forceLayout` and `apps/DeskClock/src/com/android/deskclock/Screensaver.java:161` 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) apps/Music/src/com/android/music/AlbumBrowserActivity.java:103 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:103-110 | apps/Music/src/com/android/music/PlaylistBrowserActivity.java:133-140 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) apps/Music/src/com/android/music/AlbumBrowserActivity.java:101 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:101-108 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:97-104 — before extracting anything, compare `apps/Music/src/com/android/music/AlbumBrowserActivity.java` and `apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) apps/Music/src/com/android/music/MediaPlaybackService.java:519 — apps/Music/src/com/android/music/MediaPlaybackService.java:519-526 | apps/Music/src/com/android/music/MediaPlaybackService.java:617-624 — 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 `apps/Music/src/com/android/music/MediaPlaybackService.java:519` 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) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1454 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1454-1461 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1454-1461 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 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) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1766 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1766-1773 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1766-1773 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 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) apps/Calendar/src/com/android/calendar/selectcalendars/SelectSyncedCalendarsMultiAccountActivity.java:166 — apps/Calendar/src/com/android/calendar/selectcalendars/SelectSyncedCalendarsMultiAccountActivity.java:166-173 | apps/Calendar/src/com/android/calendar/selectcalendars/SelectVisibleCalendarsActivity.java:105-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. 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) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:508 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:508-515 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:506-513 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 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) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:398 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:398-405 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:396-403 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 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: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:116 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:116-123 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:114-121 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 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) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:505 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:505-512 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:502-509 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 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) apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:59 — apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:59-66 | apps/DeskClock/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:57-64 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java` and `apps/DeskClock/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java` 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) apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:84 — apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:84-91 | apps/DeskClock/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:82-89 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java` and `apps/DeskClock/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java` 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) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:224 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:224-231 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:222-229 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 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) apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:337 — apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:337-344 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:335-342 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:346 — apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:346-353 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:344-351 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:565 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:565-572 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:563-570 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 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) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:957 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:957-964 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:955-962 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×18
  • Duplicated block (9 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:450 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:450-458 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:450-458 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2667 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2667-2675 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2669-2677 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 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 `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2667` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:443 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:443-451 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:441-449 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:82 — apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:82-90 | apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java:80-88 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/CircleView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:151 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:151-159 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:149-157 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:322 — apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:322-330 | apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:391-399 — 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 `apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:322` 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, `apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:400` calls `getLayoutParams`, `setMargins`, `requestLayout` and `apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:331` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:568 — apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:568-576 | apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:884-892 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) apps/DeskClock/src/com/android/deskclock/alarms/AlarmNotifications.java:59 — apps/DeskClock/src/com/android/deskclock/alarms/AlarmNotifications.java:59-67 | apps/DeskClock/src/com/android/deskclock/alarms/AlarmNotifications.java:100-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:703 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:703-711 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:703-711 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 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 (9 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1244 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1244-1252 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1244-1252 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 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 (9 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1256 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1256-1264 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1256-1264 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1321 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1321-1329 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1321-1329 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1342 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1342-1350 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1342-1350 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:103 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:103-111 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:101-109 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 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 (9 lines × 2) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:521 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:521-529 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:519-527 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 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 (9 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:426 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:426-434 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:424-432 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 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 (9 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:98 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:98-106 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:96-104 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthAdapter.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 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 (9 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:439 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:439-447 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:437-445 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×15
  • Duplicated block (11 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:826 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:826-836 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:826-836 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) apps/Calendar/src/com/android/calendar/DayView.java:243 — apps/Calendar/src/com/android/calendar/DayView.java:243-254 | apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:187-197 — 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 `apps/Calendar/src/com/android/calendar/DayView.java:243` 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 (11 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:115 — apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:115-125 | apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java:113-123 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:498 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:498-508 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:496-506 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:147 — apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:147-157 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:145-155 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:180 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:180-190 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:178-188 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1457 — apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1457-1467 | apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1560-1570 — 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 `apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1457` 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, `apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1456` calls `setInterpolator` and `apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1559` 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 lines × 2) apps/Music/src/com/android/music/CreatePlaylist.java:102 — apps/Music/src/com/android/music/CreatePlaylist.java:102-112 | apps/Music/src/com/android/music/RenamePlaylist.java:122-132 — 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 `apps/Music/src/com/android/music/CreatePlaylist.java:102` 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) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:683 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:683-693 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:683-693 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:239 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:239-249 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:237-247 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:257 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:257-267 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:255-265 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 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 `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:257` 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) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:248 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:248-258 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:245-255 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:966 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:966-976 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:964-974 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) apps/Music/src/com/android/music/AlbumBrowserActivity.java:631 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:631-641 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:821-831 — before extracting anything, compare `apps/Music/src/com/android/music/AlbumBrowserActivity.java` and `apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 147 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 (11 lines × 2) apps/Music/src/com/android/music/PlaylistBrowserActivity.java:616 — apps/Music/src/com/android/music/PlaylistBrowserActivity.java:616-626 | apps/Music/src/com/android/music/TrackBrowserActivity.java:1533-1543 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×13
  • Duplicated block (5 lines × 2) apps/DeskClock/src/com/android/deskclock/AlarmTimelineView.java:135 — apps/DeskClock/src/com/android/deskclock/AlarmTimelineView.java:135-139 | apps/DeskClock/src/com/android/deskclock/AlarmTimelineView.java:150-154 — 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 `apps/DeskClock/src/com/android/deskclock/AlarmTimelineView.java:135` 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) apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:942 — apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:942-946 | apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchService.java:321-325 — 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 `apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:942` 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) apps/Music/src/com/android/music/MediaPlaybackService.java:279 — apps/Music/src/com/android/music/MediaPlaybackService.java:279-283 | apps/Music/src/com/android/music/MediaPlaybackService.java:662-667 — 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 `apps/Music/src/com/android/music/MediaPlaybackService.java:279` 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) apps/Music/src/com/android/music/QueryBrowserActivity.java:286 — apps/Music/src/com/android/music/QueryBrowserActivity.java:286-290 | apps/Music/src/com/android/music/QueryBrowserActivity.java:292-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) apps/Music/src/com/android/music/TrackBrowserActivity.java:1040 — apps/Music/src/com/android/music/TrackBrowserActivity.java:1040-1044 | apps/Music/src/com/android/music/TrackBrowserActivity.java:1078-1082 — 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 `apps/Music/src/com/android/music/TrackBrowserActivity.java:1040` 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) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:637 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:637-641 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:637-641 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) apps/Calendar/src/com/android/calendar/EventInfoFragment.java:2253 — apps/Calendar/src/com/android/calendar/EventInfoFragment.java:2253-2257 | apps/Calendar/src/com/android/calendar/event/EditEventView.java:959-963 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:68 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:68-72 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:66-70 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthAdapter.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:221 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:221-225 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:219-223 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthAdapter.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:417 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:417-421 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:414-418 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) apps/DeskClock/src/com/android/deskclock/provider/Alarm.java:202 — apps/DeskClock/src/com/android/deskclock/provider/Alarm.java:202-206 | apps/DeskClock/src/com/android/deskclock/provider/AlarmInstance.java:238-242 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:272 — apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:272-276 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:270-274 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) apps/DeskClock/src/com/android/deskclock/worldclock/Cities.java:48 — apps/DeskClock/src/com/android/deskclock/worldclock/Cities.java:48-52 | apps/DeskClock/src/com/android/deskclock/worldclock/Cities.java:64-68 — 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 `apps/DeskClock/src/com/android/deskclock/worldclock/Cities.java:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×12
  • Duplicated block (12 lines × 2) apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:837 — apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:837-848 | apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:881-892 — 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 `apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:837` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:186 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:186-197 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:184-195 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/AccessibleDateAnimator.java:43 — apps/Calendar/src/com/android/datetimepicker/date/AccessibleDateAnimator.java:43-54 | apps/DeskClock/src/com/android/datetimepicker/date/AccessibleDateAnimator.java:41-52 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/AccessibleDateAnimator.java` and `apps/DeskClock/src/com/android/datetimepicker/date/AccessibleDateAnimator.java` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:629 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:629-640 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:626-637 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:242 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:242-253 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:240-251 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:300 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:300-311 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:298-309 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:362 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:362-373 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:360-371 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:377 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:377-388 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:375-386 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:621 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:621-632 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:619-630 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) apps/Music/src/com/android/music/AlbumBrowserActivity.java:238 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:238-250 | apps/Music/src/com/android/music/PlaylistBrowserActivity.java:248-259 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `apps/Music/src/com/android/music/AlbumBrowserActivity.java:238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:424 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:424-435 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:421-432 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:598 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:598-609 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:595-606 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×9
  • Edited copy of a member (16 corresponding lines) apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:271 — apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:271-286 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:269-284 — 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) apps/Calendar/src/com/android/calendar/month/MonthByWeekFragment.java:265 — apps/Calendar/src/com/android/calendar/month/MonthByWeekFragment.java:265-284 | apps/Calendar/src/com/android/calendar/month/SimpleDayPickerFragment.java:200-215 — 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) apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1459 — apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1459-1474 | apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1562-1577 — 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) apps/DeskClock/src/com/android/deskclock/Screensaver.java:152 — apps/DeskClock/src/com/android/deskclock/Screensaver.java:152-167 | apps/DeskClock/src/com/android/deskclock/ScreensaverActivity.java:190-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) apps/Calendar/src/com/android/calendar/GeneralPreferences.java:227 — apps/Calendar/src/com/android/calendar/GeneralPreferences.java:227-247 | apps/Calendar/src/com/android/calendar/event/EditEventView.java:441-456 — 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) apps/Calendar/src/com/android/calendar/DayView.java:2770 — apps/Calendar/src/com/android/calendar/DayView.java:2770-2785 | apps/Calendar/src/com/android/calendar/DayView.java:2787-2802 — 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) apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1694 — apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1694-1714 | apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1736-1751 — 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) apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:252 — apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:252-267 | apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:415-436 — 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) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2807 — apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2807-2822 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2895-2910 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×9
  • Duplicated block (13 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:604 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:604-616 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:604-616 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2377 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2377-2389 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2379-2391 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2402 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2402-2414 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2404-2416 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) apps/Calendar/src/com/android/calendar/DayView.java:3035 — apps/Calendar/src/com/android/calendar/DayView.java:3035-3047 | apps/Calendar/src/com/android/calendar/DayView.java:3152-3164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/AmPmCirclesView.java:104 — apps/Calendar/src/com/android/datetimepicker/time/AmPmCirclesView.java:104-116 | apps/DeskClock/src/com/android/datetimepicker/time/AmPmCirclesView.java:102-114 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/AmPmCirclesView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/AmPmCirclesView.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (13 lines × 2) apps/Music/src/com/android/music/AlbumBrowserActivity.java:284 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:284-296 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:368-380 — before extracting anything, compare `apps/Music/src/com/android/music/AlbumBrowserActivity.java` and `apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 147 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 `apps/Music/src/com/android/music/AlbumBrowserActivity.java:284` 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) apps/Calendar/src/com/android/datetimepicker/Utils.java:129 — apps/Calendar/src/com/android/datetimepicker/Utils.java:129-141 | apps/DeskClock/src/com/android/datetimepicker/Utils.java:127-139 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/Utils.java` and `apps/DeskClock/src/com/android/datetimepicker/Utils.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (13 lines × 2) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:275 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:275-287 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:273-285 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:168 — apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:168-180 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:166-178 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×8
  • Duplicated block (14 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1102 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1102-1115 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1102-1115 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2417 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2417-2430 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2419-2432 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) apps/Calendar/src/com/android/calendar/AllInOneActivity.java:647 — apps/Calendar/src/com/android/calendar/AllInOneActivity.java:647-660 | apps/Calendar/src/com/android/calendar/event/EditEventActivity.java:121-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `apps/Calendar/src/com/android/calendar/event/EditEventActivity.java:136` calls `getBooleanExtra` and `apps/Calendar/src/com/android/calendar/AllInOneActivity.java:662` 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) apps/Calendar/src/com/android/calendar/EventGeometry.java:141 — apps/Calendar/src/com/android/calendar/EventGeometry.java:141-154 | apps/Calendar/src/com/android/calendar/EventGeometry.java:156-169 — 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 `apps/Calendar/src/com/android/calendar/EventGeometry.java:141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:647 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:647-660 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:645-658 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) apps/Music/src/com/android/music/MediaPlaybackActivity.java:900 — apps/Music/src/com/android/music/MediaPlaybackActivity.java:900-913 | apps/Music/src/com/android/music/MediaPlaybackActivity.java:939-952 — 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 `apps/Music/src/com/android/music/MediaPlaybackActivity.java:900` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) apps/Music/src/com/android/music/MusicPicker.java:232 — apps/Music/src/com/android/music/MusicPicker.java:232-245 | apps/Music/src/com/android/music/TrackBrowserActivity.java:1470-1483 — 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 (14 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:383 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:383-396 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:383-396 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×8
  • Duplicated block (6 lines × 2) apps/Calendar/src/com/android/calendar/month/MonthByWeekAdapter.java:237 — apps/Calendar/src/com/android/calendar/month/MonthByWeekAdapter.java:237-242 | apps/Calendar/src/com/android/calendar/month/SimpleWeeksAdapter.java:235-240 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:308 — apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:308-313 | apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:330-335 — 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 `apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:308` 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 (6 lines × 2) apps/Music/src/com/android/music/MusicUtils.java:112 — apps/Music/src/com/android/music/MusicUtils.java:112-117 | apps/Music/src/com/android/music/MusicUtils.java:139-144 — 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 `apps/Music/src/com/android/music/MusicUtils.java:112` 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 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:155 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:155-160 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:153-158 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:425 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:425-430 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:423-428 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:381 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:381-386 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:378-383 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) apps/Music/src/com/android/music/AlbumBrowserActivity.java:415 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:415-420 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:284-289 — before extracting anything, compare `apps/Music/src/com/android/music/AlbumBrowserActivity.java` and `apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 147 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) apps/DeskClock/src/com/android/deskclock/provider/Alarm.java:188 — apps/DeskClock/src/com/android/deskclock/provider/Alarm.java:188-193 | apps/DeskClock/src/com/android/deskclock/provider/City.java:133-138 — 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.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×7
  • Edited copy of a member (21 corresponding lines) apps/CandyExperience/src/org/candyos/experience/Configs.kt:46 — apps/CandyExperience/src/org/candyos/experience/Configs.kt:46-66 | apps/CandyExperience/src/org/candyos/experience/Configs.kt:122-148 — 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) apps/Music/src/com/android/music/MediaPlaybackService.java:762 — apps/Music/src/com/android/music/MediaPlaybackService.java:762-788 | apps/SoundRecorder/src/com/android/soundrecorder/SoundRecorder.java:527-547 — 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) apps/Music/src/com/android/music/AlbumBrowserActivity.java:382 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:382-402 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:496-521 — 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) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2533 — apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2533-2553 | apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2556-2576 — 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) apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:822 — apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:822-845 | apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:852-872 — 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) apps/Calendar/src/com/android/timezonepicker/TimeZonePickerUtils.java:123 — apps/Calendar/src/com/android/timezonepicker/TimeZonePickerUtils.java:123-143 | apps/DeskClock/src/com/android/deskclock/Utils.java:557-578 — 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) apps/Calendar/src/com/android/calendar/event/EditEventView.java:1593 — apps/Calendar/src/com/android/calendar/event/EditEventView.java:1593-1613 | apps/Calendar/src/com/android/calendar/event/EditEventView.java:1615-1636 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×7
  • Edited copy of a member (14 corresponding lines) apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:214 — apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:214-233 | apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:236-249 — 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) apps/Music/src/com/android/music/MusicUtils.java:329 — apps/Music/src/com/android/music/MusicUtils.java:329-343 | apps/Music/src/com/android/music/MusicUtils.java:345-358 — 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) apps/DeskClock/src/com/android/deskclock/timer/TimerObj.java:242 — apps/DeskClock/src/com/android/deskclock/timer/TimerObj.java:242-259 | apps/DeskClock/src/com/android/deskclock/timer/TimerObj.java:262-275 — 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) apps/Music/src/com/android/music/AlbumBrowserActivity.java:552 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:552-565 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:611-624 — 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) apps/Music/src/com/android/music/CreatePlaylist.java:82 — apps/Music/src/com/android/music/CreatePlaylist.java:82-95 | apps/Music/src/com/android/music/RenamePlaylist.java:105-119 — 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) apps/Notes/src/org/candyos/notes/MainActivity.kt:24 — apps/Notes/src/org/candyos/notes/MainActivity.kt:24-40 | apps/Reminders/src/org/candyos/reminders/MainActivity.kt:30-43 — 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) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2662 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2662-2675 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2664-2677 — 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 · Duplicated block (24 lines × 2) · ×7
  • Duplicated block (24 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2481 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2481-2504 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2483-2506 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2573 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2573-2596 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2575-2598 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:444 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:444-467 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:441-464 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:242 — apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:242-265 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:240-263 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:577 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:577-600 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:575-598 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1412 — apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1412-1435 | apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1525-1548 — 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 `apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1412` 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, `apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1436` calls `getHeight` and `apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1549` 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 (24 lines × 2) apps/Music/src/com/android/music/AlbumBrowserActivity.java:159 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:159-182 | apps/Music/src/com/android/music/PlaylistBrowserActivity.java:187-210 — 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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×7
  • Duplicated block (18 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2144 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2144-2161 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2146-2163 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2267 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2267-2284 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2269-2286 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) apps/Calendar/src/com/android/calendar/DayView.java:4361 — apps/Calendar/src/com/android/calendar/DayView.java:4361-4378 | apps/Calendar/src/com/android/calendar/DayView.java:4397-4414 — 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 `apps/Calendar/src/com/android/calendar/DayView.java:4361` 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) apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:1056 — apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:1056-1073 | apps/Calendar/src/com/android/calendar/month/SimpleWeekView.java:525-542 — 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 `apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:1056` 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) apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java:228 — apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java:228-245 | apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSyncAdapter.java:157-174 — before extracting anything, compare `apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java` and `apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSyncAdapter.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 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 `apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java:228` 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) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:420 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:420-437 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:418-435 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) apps/Music/src/com/android/music/CreatePlaylist.java:46 — apps/Music/src/com/android/music/CreatePlaylist.java:46-63 | apps/Music/src/com/android/music/RenamePlaylist.java:47-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×6
  • Edited copy of a member (13 corresponding lines) apps/DeskClock/src/com/android/deskclock/worldclock/Cities.java:46 — apps/DeskClock/src/com/android/deskclock/worldclock/Cities.java:46-58 | apps/DeskClock/src/com/android/deskclock/worldclock/Cities.java:60-73 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) apps/Calendar/src/com/android/calendar/CalendarEventModel.java:450 — apps/Calendar/src/com/android/calendar/CalendarEventModel.java:450-462 | apps/Calendar/src/com/android/calendar/event/AttendeesView.java:385-397 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:567 — apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:567-579 | apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:883-895 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) apps/DeskClock/src/com/android/deskclock/DeskClock.java:186 — apps/DeskClock/src/com/android/deskclock/DeskClock.java:186-203 | apps/DeskClock/src/com/android/deskclock/DeskClock.java:206-218 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) apps/Calendar/src/com/android/calendar/DayView.java:4906 — apps/Calendar/src/com/android/calendar/DayView.java:4906-4921 | apps/Calendar/src/com/android/calendar/DayView.java:4924-4936 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) apps/Calendar/src/com/android/calendar/Utils.java:570 — apps/Calendar/src/com/android/calendar/Utils.java:570-582 | apps/Calendar/src/com/android/calendar/alerts/GlobalDismissManager.java:399-413 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×6
  • Duplicated block (19 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2713 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2713-2731 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2715-2733 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2786 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2786-2804 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2786-2804 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) apps/Calendar/src/com/android/calendar/DayView.java:1410 — apps/Calendar/src/com/android/calendar/DayView.java:1410-1428 | apps/Calendar/src/com/android/calendar/DayView.java:1446-1464 — 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 `apps/Calendar/src/com/android/calendar/DayView.java:1446` 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) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:336 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:336-354 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:334-352 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:61 — apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:61-79 | apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java:59-77 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/CircleView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (19 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:403 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:403-421 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:401-419 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×6
  • Duplicated block (17 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1268 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1268-1284 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1268-1284 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:1036 — apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:1036-1052 | apps/Calendar/src/com/android/calendar/month/SimpleWeekView.java:375-391 — 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 `apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:1036` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:382 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:382-398 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:380-396 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:57 — apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:57-73 | apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java:55-71 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (17 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:759 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:759-775 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:757-773 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:177 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:177-193 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:175-191 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×6
  • Duplicated block (16 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:619 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:619-634 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:619-634 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) apps/Calendar/src/com/android/common/contacts/DataUsageStatUpdater.java:124 — apps/Calendar/src/com/android/common/contacts/DataUsageStatUpdater.java:124-139 | apps/Calendar/src/com/android/common/contacts/DataUsageStatUpdater.java:174-189 — 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 `apps/Calendar/src/com/android/common/contacts/DataUsageStatUpdater.java:124` 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) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:408 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:408-423 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:406-421 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:86 — apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:86-101 | apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java:84-99 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2002 — apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2002-2017 | apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2027-2042 — 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 `apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2002` 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) apps/Music/src/com/android/music/AlbumBrowserActivity.java:336 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:336-351 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:446-461 — before extracting anything, compare `apps/Music/src/com/android/music/AlbumBrowserActivity.java` and `apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 147 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 `apps/Music/src/com/android/music/AlbumBrowserActivity.java:336` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×6
  • Duplicated block (15 lines × 2) apps/Calendar/src/com/android/calendar/DayView.java:3381 — apps/Calendar/src/com/android/calendar/DayView.java:3381-3395 | apps/Calendar/src/com/android/calendar/DayView.java:3405-3419 — 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 `apps/Calendar/src/com/android/calendar/DayView.java:3381` 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) apps/Calendar/src/com/android/calendar/Event.java:161 — apps/Calendar/src/com/android/calendar/Event.java:161-175 | apps/Calendar/src/com/android/calendar/Event.java:182-196 — 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 what the matched lines are: every one of them assigns one field to another, so the block is a hand-written mapper between two data shapes rather than behaviour with a helper inside it. Extracting one shared function only works if both sites map the SAME pair of types in the same direction — check that first, because inverse or differently-typed mappers have no single function they can both call. Where they do not, the moves that exist are a generated or reflective mapper, a common embedded/base type the fields live on once, or accepting the run and covering it with a test that fails when a field is added to one side only.
  • Duplicated block (15 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:483 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:483-497 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:480-494 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) apps/DeskClock/src/com/android/deskclock/widget/sgv/SgvAnimationHelper.java:207 — apps/DeskClock/src/com/android/deskclock/widget/sgv/SgvAnimationHelper.java:207-221 | apps/DeskClock/src/com/android/deskclock/widget/sgv/SgvAnimationHelper.java:230-244 — 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 `apps/DeskClock/src/com/android/deskclock/widget/sgv/SgvAnimationHelper.java:207` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) apps/Music/src/com/android/music/MediaPlaybackActivity.java:877 — apps/Music/src/com/android/music/MediaPlaybackActivity.java:877-891 | apps/Music/src/com/android/music/MediaPlaybackActivity.java:916-930 — 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 `apps/Music/src/com/android/music/MediaPlaybackActivity.java:877` 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 (15 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:149 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:149-163 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:147-161 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (4 members, 50+ identical tokens) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1493 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1493-1599 | apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1666-1729 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1493-1599 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1666-1729 — 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) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1920 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1920-2041 | apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2292-2313 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1920-2043 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2294-2315 — 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) apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:235 — apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:235-246 | apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:304-324 | apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:326-356 | apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:487-504 — 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) apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:94 — apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:94-123 | apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:274-324 | apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java:92-121 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:272-322 — 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) apps/DeskClock/src/com/android/deskclock/alarms/AlarmNotifications.java:58 — apps/DeskClock/src/com/android/deskclock/alarms/AlarmNotifications.java:58-97 | apps/DeskClock/src/com/android/deskclock/alarms/AlarmNotifications.java:99-132 | apps/DeskClock/src/com/android/deskclock/alarms/AlarmNotifications.java:134-167 | apps/DeskClock/src/com/android/deskclock/alarms/AlarmStateManager.java:676-716 — 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 (11 corresponding lines) · ×5
  • Edited copy of a member (11 corresponding lines) apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:561 — apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:561-573 | apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:1155-1165 — 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) apps/DeskClock/src/com/android/deskclock/timer/Timers.java:70 — apps/DeskClock/src/com/android/deskclock/timer/Timers.java:70-80 | apps/DeskClock/src/com/android/deskclock/timer/Timers.java:82-92 — 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) apps/Calendar/src/com/android/calendar/event/CreateEventDialogFragment.java:250 — apps/Calendar/src/com/android/calendar/event/CreateEventDialogFragment.java:250-260 | apps/Calendar/src/com/android/calendar/event/EditEventView.java:655-667 — 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) apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:1131 — apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:1131-1141 | apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:1143-1153 — 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) apps/Music/src/com/android/music/PlaylistBrowserActivity.java:362 — apps/Music/src/com/android/music/PlaylistBrowserActivity.java:362-372 | apps/Music/src/com/android/music/QueryBrowserActivity.java:245-255 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×5
  • Low cohesion: CalculatorDisplay (LCOM4 6) apps/Calculator/src/com/android/calculator2/CalculatorDisplay.java:33 — CalculatorDisplay'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: BaseEmailAddressAdapter (LCOM4 5) apps/Calendar/src/com/android/common/contacts/BaseEmailAddressAdapter.java:53 — BaseEmailAddressAdapter'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: DayPickerView (LCOM4 5) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:47 — DayPickerView'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: DayPickerView (LCOM4 5) apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:45 — DayPickerView'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: SelectSyncedCalendarsMultiAccountAdapter (LCOM4 4) apps/Calendar/src/com/android/calendar/selectcalendars/SelectSyncedCalendarsMultiAccountAdapter.java:53 — SelectSyncedCalendarsMultiAccountAdapter'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.
IC1 · Incompleteness & stubs · Dead branch · ×5
  • Dead branch — condition is always false apps/Calendar/src/com/android/calendarcommon2/ICalendar.java:451 — A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition.
  • Dead branch — condition is always false apps/Calendar/src/com/android/calendarcommon2/RecurrenceSet.java:222 — A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition.
  • Dead branch — condition is always false apps/Calendar/src/com/android/calendarcommon2/RecurrenceSet.java:236 — A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition.
  • Dead branch — condition is always false apps/Calendar/src/com/android/timezonepicker/TimeZoneData.java:237 — A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition.
  • Dead branch — condition is always false apps/DeskClock/src/com/android/deskclock/widget/sgv/OverScrollerSGV.java:836 — A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×4
  • Edited copy of a member (28 corresponding lines) apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:238 — apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:238-265 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:236-263 — 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.
  • Edited copy of a member (28 corresponding lines) apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:488 — apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:488-524 | apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:526-553 — 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.
  • Edited copy of a member (28 corresponding lines) apps/DeskClock/src/com/android/alarmclock/WidgetUtils.java:43 — apps/DeskClock/src/com/android/alarmclock/WidgetUtils.java:43-70 | apps/DeskClock/src/com/android/alarmclock/WidgetUtils.java:73-100 — 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.
  • Edited copy of a member (28 corresponding lines) apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:252 — apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:252-281 | apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:292-319 — 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 (10 corresponding lines) · ×4
  • Edited copy of a member (10 corresponding lines) apps/CandyExperience/src/org/candyos/experience/WallpapersActivity.kt:45 — apps/CandyExperience/src/org/candyos/experience/WallpapersActivity.kt:45-54 | apps/CandyExperience/src/org/candyos/experience/WallpapersActivity.kt:58-70 — 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) apps/Calendar/src/com/android/common/contacts/BaseEmailAddressAdapter.java:591 — apps/Calendar/src/com/android/common/contacts/BaseEmailAddressAdapter.java:591-603 | apps/Calendar/src/com/android/ex/chips/BaseRecipientAdapter.java:339-348 — 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) apps/SoundRecorder/src/com/android/soundrecorder/SoundRecorder.java:255 — apps/SoundRecorder/src/com/android/soundrecorder/SoundRecorder.java:255-265 | apps/Music/src/com/android/music/MusicBrowserActivity.java:51-60 — 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) apps/Reminders/src/org/candyos/reminders/ReminderEditActivity.kt:102 — apps/Reminders/src/org/candyos/reminders/ReminderEditActivity.kt:102-115 | apps/Notes/src/org/candyos/notes/NoteEditActivity.kt:69-78 — 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 (7 corresponding lines) · ×4
  • Edited copy of a member (7 corresponding lines) apps/Calendar/src/com/android/calendar/month/MonthByWeekFragment.java:329 — apps/Calendar/src/com/android/calendar/month/MonthByWeekFragment.java:329-340 | apps/Calendar/src/com/android/calendar/month/SimpleDayPickerFragment.java:248-254 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) apps/DeskClock/src/com/android/deskclock/TimerRingService.java:176 — apps/DeskClock/src/com/android/deskclock/TimerRingService.java:176-183 | apps/DeskClock/src/com/android/deskclock/alarms/AlarmKlaxon.java:143-149 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) apps/Notes/src/org/candyos/notes/MainActivity.kt:47 — apps/Notes/src/org/candyos/notes/MainActivity.kt:47-53 | apps/Reminders/src/org/candyos/reminders/MainActivity.kt:50-56 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) apps/DeskClock/src/com/android/deskclock/Screensaver.java:95 — apps/DeskClock/src/com/android/deskclock/Screensaver.java:95-101 | apps/DeskClock/src/com/android/deskclock/ScreensaverActivity.java:156-162 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×4
  • Duplicated block (41 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:509 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:509-549 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:509-549 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (41 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2207 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2207-2247 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2209-2249 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (41 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:162 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:162-202 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthAdapter.java:160-200 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthAdapter.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthAdapter.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (41 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:104 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:104-144 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:102-142 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×4
  • Duplicated block (39 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:785 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:785-823 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:785-823 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (39 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2165 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2165-2203 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2167-2205 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (39 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2323 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2323-2361 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2325-2363 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (39 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:470 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:470-508 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:468-506 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×4
  • Duplicated block (29 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1732 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1732-1760 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1732-1760 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (29 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/AmPmCirclesView.java:73 — apps/Calendar/src/com/android/datetimepicker/time/AmPmCirclesView.java:73-101 | apps/DeskClock/src/com/android/datetimepicker/time/AmPmCirclesView.java:71-99 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/AmPmCirclesView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/AmPmCirclesView.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (29 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:778 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:778-806 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:776-804 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (29 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/EdgeEffectCompat.java:36 — apps/Calculator/src/com/android/calculator2/viewpager/EdgeEffectCompat.java:36-64 | apps/DeskClock/src/com/android/deskclock/viewpager/EdgeEffectCompat.java:36-64 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/EdgeEffectCompat.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/EdgeEffectCompat.java` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×4
  • Duplicated block (26 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:350 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:350-375 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:350-375 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `EdgeEffectCompat` names `com.android.calculator2.viewpager.EdgeEffectCompat` in one and `com.android.deskclock.viewpager.EdgeEffectCompat` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (26 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1627 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1627-1652 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1627-1652 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (26 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2683 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2683-2708 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2685-2710 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (26 lines × 2) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:611 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:611-636 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:609-634 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×4
  • Duplicated block (22 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1603 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1603-1624 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1603-1624 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:382 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:382-403 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:380-401 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:347 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:347-368 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:345-366 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:102 — apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:102-123 | apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java:100-121 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/CircleView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 86 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 `apps/Calendar/src/com/android/datetimepicker/time/CircleView.java: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.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×3
  • Edited copy of a member (22 corresponding lines) apps/Music/src/com/android/music/MediaPlaybackService.java:1568 — apps/Music/src/com/android/music/MediaPlaybackService.java:1568-1593 | apps/Music/src/com/android/music/MusicUtils.java:380-401 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) apps/DeskClock/src/com/android/deskclock/provider/Alarm.java:79 — apps/DeskClock/src/com/android/deskclock/provider/Alarm.java:79-100 | apps/DeskClock/src/com/android/deskclock/provider/AlarmInstance.java:96-119 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) apps/Calendar/src/com/android/calendar/alerts/GlobalDismissManager.java:70 — apps/Calendar/src/com/android/calendar/alerts/GlobalDismissManager.java:70-91 | apps/Calendar/src/com/android/calendar/alerts/GlobalDismissManager.java:123-147 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×3
  • Edited copy of a member (18 corresponding lines) apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchService.java:372 — apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchService.java:372-389 | apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchService.java:417-435 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) apps/Calendar/src/com/android/calendar/Event.java:157 — apps/Calendar/src/com/android/calendar/Event.java:157-178 | apps/Calendar/src/com/android/calendar/Event.java:180-197 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) apps/Calendar/src/com/android/calendar/EventInfoFragment.java:2140 — apps/Calendar/src/com/android/calendar/EventInfoFragment.java:2140-2157 | apps/Calendar/src/com/android/calendar/event/EditEventView.java:1546-1564 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×3
  • Edited copy of a member (12 corresponding lines) apps/Calendar/src/com/android/calendar/Utils.java:1380 — apps/Calendar/src/com/android/calendar/Utils.java:1380-1391 | apps/DeskClock/src/com/android/deskclock/Utils.java:371-382 — 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) apps/DeskClock/src/com/android/deskclock/TimerRingService.java:161 — apps/DeskClock/src/com/android/deskclock/TimerRingService.java:161-173 | apps/DeskClock/src/com/android/deskclock/alarms/AlarmKlaxon.java:129-140 — 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) apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:99 — apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:99-110 | apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:613-628 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×3
  • Edited copy of a member (8 corresponding lines) apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:75 — apps/Calendar/src/com/android/datetimepicker/date/YearPickerView.java:75-82 | apps/DeskClock/src/com/android/datetimepicker/date/YearPickerView.java:73-80 — 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) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:408 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:408-415 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:405-412 — 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) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2876 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2876-2883 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2876-2883 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×3
  • Edited copy of a member (9 corresponding lines) apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:49 — apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:49-57 | apps/DeskClock/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:47-55 — 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) apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:699 — apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:699-707 | apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:736-745 — 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) apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:73 — apps/Calendar/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:73-81 | apps/DeskClock/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java:71-79 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (45 lines × 2) · ×3
  • Duplicated block (45 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2051 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2051-2095 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2053-2097 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (45 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:288 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:288-332 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:286-330 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (45 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:438 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:438-482 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:436-480 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×3
  • Duplicated block (27 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:553 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:553-579 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:553-579 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (27 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1464 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1464-1490 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1464-1490 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (27 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:292 — apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:292-318 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:290-316 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1288 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1288-1310 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1288-1310 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:335 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:335-357 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:333-355 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:395 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:395-417 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:393-415 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×3
  • Duplicated block (21 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2293 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2293-2313 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2295-2315 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/AmPmCirclesView.java:130 — apps/Calendar/src/com/android/datetimepicker/time/AmPmCirclesView.java:130-150 | apps/DeskClock/src/com/android/datetimepicker/time/AmPmCirclesView.java:128-148 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/AmPmCirclesView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/AmPmCirclesView.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2444 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2444-2464 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2446-2466 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×3
  • Duplicated block (20 lines × 2) apps/Calendar/src/com/android/datetimepicker/Utils.java:64 — apps/Calendar/src/com/android/datetimepicker/Utils.java:64-83 | apps/DeskClock/src/com/android/datetimepicker/Utils.java:62-81 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/Utils.java` and `apps/DeskClock/src/com/android/datetimepicker/Utils.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (20 lines × 2) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:147 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:147-166 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:145-164 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) apps/Music/src/com/android/music/AlbumBrowserActivity.java:430 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:430-449 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:299-318 — before extracting anything, compare `apps/Music/src/com/android/music/AlbumBrowserActivity.java` and `apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 147 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×3
  • Duplicated block (15–16 lines × 2) apps/Calendar/src/com/android/calendar/DayView.java:256 — apps/Calendar/src/com/android/calendar/DayView.java:256-270 | apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:199-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 `apps/Calendar/src/com/android/calendar/DayView.java:256` 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–16 lines × 2) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:552 — apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:552-567 | apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:595-609 — 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 after the matched lines, `apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:610` calls `getChipBackground` and `apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:568` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15–16 lines × 2) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:919 — apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:919-933 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:956-971 — 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 `apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:919` 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.
X3 · Exception handling · Swallowed exception (empty catch) · ×3
  • Swallowed exception (empty catch) apps/Music/src/com/android/music/MediaPlaybackService.java:1586 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) apps/Music/src/com/android/music/TrackBrowserActivity.java:433 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) apps/Calendar/src/com/android/calendar/alerts/AlertService.java:214 — 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.
D1 · Cyclomatic Complexity · ViewPager.populate (cyclomatic 59) · ×2
  • ViewPager.populate (cyclomatic 59) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:913 — ViewPager.populate has cyclomatic complexity 59 (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.
  • ViewPager.populate (cyclomatic 59) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:913 — ViewPager.populate has cyclomatic complexity 59 (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.
D1 · Cyclomatic Complexity · RadialPickerLayout.onTouch (cyclomatic 31) · ×2
  • RadialPickerLayout.onTouch (cyclomatic 31) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:566 — RadialPickerLayout.onTouch has cyclomatic complexity 31 (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.
  • RadialPickerLayout.onTouch (cyclomatic 31) apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:564 — RadialPickerLayout.onTouch has cyclomatic complexity 31 (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.
D1 · Cyclomatic Complexity · ViewPager.onInterceptTouchEvent (cyclomatic 29) · ×2
  • ViewPager.onInterceptTouchEvent (cyclomatic 29) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1776 — ViewPager.onInterceptTouchEvent has cyclomatic complexity 29 (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.
  • ViewPager.onInterceptTouchEvent (cyclomatic 29) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1776 — ViewPager.onInterceptTouchEvent has cyclomatic complexity 29 (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.
D1 · Cyclomatic Complexity · ViewPager.onTouchEvent (cyclomatic 24) · ×2
  • ViewPager.onTouchEvent (cyclomatic 24) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1920 — ViewPager.onTouchEvent has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ViewPager.onTouchEvent (cyclomatic 24) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1920 — ViewPager.onTouchEvent has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ViewPager.calculatePageOffsets (cyclomatic 23) · ×2
  • ViewPager.calculatePageOffsets (cyclomatic 23) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1117 — ViewPager.calculatePageOffsets has cyclomatic complexity 23 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • ViewPager.calculatePageOffsets (cyclomatic 23) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1117 — ViewPager.calculatePageOffsets has cyclomatic complexity 23 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · TimePickerDialog.processKeyUp (cyclomatic 22) · ×2
  • TimePickerDialog.processKeyUp (cyclomatic 22) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:491 — TimePickerDialog.processKeyUp has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TimePickerDialog.processKeyUp (cyclomatic 22) apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:489 — TimePickerDialog.processKeyUp has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ViewPager.arrowScroll (cyclomatic 20) · ×2
  • ViewPager.arrowScroll (cyclomatic 20) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2506 — ViewPager.arrowScroll 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.
  • ViewPager.arrowScroll (cyclomatic 20) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2508 — ViewPager.arrowScroll 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.
D1 · Cyclomatic Complexity · ViewPager.onMeasure (cyclomatic 20) · ×2
  • ViewPager.onMeasure (cyclomatic 20) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1359 — ViewPager.onMeasure 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.
  • ViewPager.onMeasure (cyclomatic 20) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1359 — ViewPager.onMeasure 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.
D1 · Cyclomatic Complexity · RadialSelectorView.getDegreesFromCoords (cyclomatic 18) · ×2
  • RadialSelectorView.getDegreesFromCoords (cyclomatic 18) apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:197 — RadialSelectorView.getDegreesFromCoords 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.
  • RadialSelectorView.getDegreesFromCoords (cyclomatic 18) apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:195 — RadialSelectorView.getDegreesFromCoords 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.
D1 · Cyclomatic Complexity · ViewPager.onLayout (cyclomatic 17) · ×2
  • ViewPager.onLayout (cyclomatic 17) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1493 — ViewPager.onLayout 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.
  • ViewPager.onLayout (cyclomatic 17) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1493 — ViewPager.onLayout 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.
D1 · Cyclomatic Complexity · TimePickerDialog.onCreateView (cyclomatic 17) · ×2
  • TimePickerDialog.onCreateView (cyclomatic 17) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:193 — TimePickerDialog.onCreateView 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.
  • TimePickerDialog.onCreateView (cyclomatic 17) apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:191 — TimePickerDialog.onCreateView 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.
D1 · Cyclomatic Complexity · RadialPickerLayout.reselectSelector (cyclomatic 16) · ×2
  • RadialPickerLayout.reselectSelector (cyclomatic 16) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:436 — RadialPickerLayout.reselectSelector 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.
  • RadialPickerLayout.reselectSelector (cyclomatic 16) apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:434 — RadialPickerLayout.reselectSelector 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.
D17 · Explicit Debt · HackComment · ×2
  • HackComment apps/Music/src/com/android/music/TouchInterceptor.java:211 — // HACK force update of mItemCount — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment apps/Calculator/src/com/android/calculator2/CalculatorEditText.java:57 — // Hack to prevent keyboard and insertion handle from showing. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D17 · Explicit Debt · XxxComment · ×2
  • XxxComment apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:830 — // XXX Do we generate days for MONTHLY w/ BYHOUR? If so, — 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.
  • XxxComment apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:1068 — // XXX: We do this for days, because there is a varying number of days — 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.
D2 · Cognitive Complexity · ViewPager.populate (cognitive 142) · ×2
  • ViewPager.populate (cognitive 142) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:913 — ViewPager.populate has cognitive complexity 142 (threshold 15). Drivers by points: if/else 30 (74 pts), ternaries 13 (44 pts), loops 6 (12 pts), boolean chains 10, error handling 1 (2 pts) (nesting depth added 82). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ViewPager.populate (cognitive 142) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:913 — ViewPager.populate has cognitive complexity 142 (threshold 15). Drivers by points: if/else 30 (74 pts), ternaries 13 (44 pts), loops 6 (12 pts), boolean chains 10, error handling 1 (2 pts) (nesting depth added 82). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RadialPickerLayout.onTouch (cognitive 61) · ×2
  • RadialPickerLayout.onTouch (cognitive 61) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:566 — RadialPickerLayout.onTouch has cognitive complexity 61 (threshold 15). Drivers by points: if/else 22 (53 pts), boolean chains 7, match/switch 1 (nesting depth added 31). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • RadialPickerLayout.onTouch (cognitive 61) apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:564 — RadialPickerLayout.onTouch has cognitive complexity 61 (threshold 15). Drivers by points: if/else 22 (53 pts), boolean chains 7, match/switch 1 (nesting depth added 31). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ViewPager.onInterceptTouchEvent (cognitive 50) · ×2
  • ViewPager.onInterceptTouchEvent (cognitive 50) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1776 — ViewPager.onInterceptTouchEvent has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (42 pts), boolean chains 4, ternaries 1 (3 pts), match/switch 1 (nesting depth added 23). 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.
  • ViewPager.onInterceptTouchEvent (cognitive 50) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1776 — ViewPager.onInterceptTouchEvent has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (42 pts), boolean chains 4, ternaries 1 (3 pts), match/switch 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ViewPager.onMeasure (cognitive 47) · ×2
  • ViewPager.onMeasure (cognitive 47) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1359 — ViewPager.onMeasure has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (41 pts), boolean chains 4, loops 2 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ViewPager.onMeasure (cognitive 47) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1359 — ViewPager.onMeasure has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (41 pts), boolean chains 4, loops 2 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ViewPager.calculatePageOffsets (cognitive 43) · ×2
  • ViewPager.calculatePageOffsets (cognitive 43) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1117 — ViewPager.calculatePageOffsets has cognitive complexity 43 (threshold 15). Drivers by points: loops 10 (28 pts), if/else 5 (8 pts), boolean chains 4, ternaries 3 (nesting depth added 21). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • ViewPager.calculatePageOffsets (cognitive 43) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1117 — ViewPager.calculatePageOffsets has cognitive complexity 43 (threshold 15). Drivers by points: loops 10 (28 pts), if/else 5 (8 pts), boolean chains 4, ternaries 3 (nesting depth added 21). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · TimePickerDialog.processKeyUp (cognitive 39) · ×2
  • TimePickerDialog.processKeyUp (cognitive 39) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:491 — TimePickerDialog.processKeyUp has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TimePickerDialog.processKeyUp (cognitive 39) apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:489 — TimePickerDialog.processKeyUp has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ViewPager.onTouchEvent (cognitive 35) · ×2
  • ViewPager.onTouchEvent (cognitive 35) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1920 — ViewPager.onTouchEvent has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (27 pts), ternaries 1 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ViewPager.onTouchEvent (cognitive 35) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1920 — ViewPager.onTouchEvent has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (27 pts), ternaries 1 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ViewPager.arrowScroll (cognitive 32) · ×2
  • ViewPager.arrowScroll (cognitive 32) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2506 — ViewPager.arrowScroll has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 5, loops 2 (5 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.
  • ViewPager.arrowScroll (cognitive 32) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2508 — ViewPager.arrowScroll has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 5, loops 2 (5 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.
D2 · Cognitive Complexity · ViewPager.onLayout (cognitive 30) · ×2
  • ViewPager.onLayout (cognitive 30) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1493 — ViewPager.onLayout has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (8 pts), loops 2, boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ViewPager.onLayout (cognitive 30) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1493 — ViewPager.onLayout has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (8 pts), loops 2, boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ViewPager.dataSetChanged (cognitive 24) · ×2
  • ViewPager.dataSetChanged (cognitive 24) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:838 — ViewPager.dataSetChanged has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (3 pts), boolean chains 1 (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.
  • ViewPager.dataSetChanged (cognitive 24) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:838 — ViewPager.dataSetChanged has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RadialSelectorView.getDegreesFromCoords (cognitive 23) · ×2
  • RadialSelectorView.getDegreesFromCoords (cognitive 23) apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:197 — RadialSelectorView.getDegreesFromCoords has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 6 (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.
  • RadialSelectorView.getDegreesFromCoords (cognitive 23) apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:195 — RadialSelectorView.getDegreesFromCoords has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · ViewPager.addFocusables (cognitive 20) · ×2
  • ViewPager.addFocusables (cognitive 20) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2618 — ViewPager.addFocusables has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ViewPager.addFocusables (cognitive 20) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2620 — ViewPager.addFocusables has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ViewPager.onPageScrolled (cognitive 20) · ×2
  • ViewPager.onPageScrolled (cognitive 20) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1666 — ViewPager.onPageScrolled has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ViewPager.onPageScrolled (cognitive 20) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1666 — ViewPager.onPageScrolled has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RadialPickerLayout.reselectSelector (cognitive 20) · ×2
  • RadialPickerLayout.reselectSelector (cognitive 20) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:436 — RadialPickerLayout.reselectSelector has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5 (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.
  • RadialPickerLayout.reselectSelector (cognitive 20) apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:434 — RadialPickerLayout.reselectSelector has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · TimePickerDialog.getEnteredTime (cognitive 19) · ×2
  • TimePickerDialog.getEnteredTime (cognitive 19) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:736 — TimePickerDialog.getEnteredTime has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TimePickerDialog.getEnteredTime (cognitive 19) apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:734 — TimePickerDialog.getEnteredTime has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ViewPager.onDraw (cognitive 18) · ×2
  • ViewPager.onDraw (cognitive 18) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2206 — ViewPager.onDraw has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ViewPager.onDraw (cognitive 18) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2208 — ViewPager.onDraw has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ViewPager.setCurrentItemInternal (cognitive 18) · ×2
  • ViewPager.setCurrentItemInternal (cognitive 18) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:508 — ViewPager.setCurrentItemInternal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, loops 1 (2 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.
  • ViewPager.setCurrentItemInternal (cognitive 18) apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:508 — ViewPager.setCurrentItemInternal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, loops 1 (2 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.
D2 · Cognitive Complexity · TimePickerDialog.onCreateView (cognitive 18) · ×2
  • TimePickerDialog.onCreateView (cognitive 18) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:193 — TimePickerDialog.onCreateView has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 11 (12 pts), if/else 5, boolean chains 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.
  • TimePickerDialog.onCreateView (cognitive 18) apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:191 — TimePickerDialog.onCreateView has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 11 (12 pts), if/else 5, boolean chains 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.
D2 · Cognitive Complexity · TimePickerDialog.updateDisplay (cognitive 18) · ×2
  • TimePickerDialog.updateDisplay (cognitive 18) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:669 — TimePickerDialog.updateDisplay has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 4 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TimePickerDialog.updateDisplay (cognitive 18) apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:667 — TimePickerDialog.updateDisplay has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 4 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScrollStateRunnable.run (cognitive 17) · ×2
  • ScrollStateRunnable.run (cognitive 17) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:304 — ScrollStateRunnable.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ScrollStateRunnable.run (cognitive 17) apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:302 — ScrollStateRunnable.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RadialPickerLayout.performAccessibilityAction (cognitive 17) · ×2
  • RadialPickerLayout.performAccessibilityAction (cognitive 17) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:783 — RadialPickerLayout.performAccessibilityAction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (17 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RadialPickerLayout.performAccessibilityAction (cognitive 17) apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:781 — RadialPickerLayout.performAccessibilityAction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (17 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DayPickerView.goTo (cognitive 16) · ×2
  • DayPickerView.goTo (cognitive 16) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:180 — DayPickerView.goTo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, loops 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.
  • DayPickerView.goTo (cognitive 16) apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:178 — DayPickerView.goTo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, loops 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.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×2
  • Edited copy of a member (38 corresponding lines) apps/Calendar/src/com/android/common/contacts/DataUsageStatUpdater.java:107 — apps/Calendar/src/com/android/common/contacts/DataUsageStatUpdater.java:107-145 | apps/Calendar/src/com/android/common/contacts/DataUsageStatUpdater.java:157-194 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) apps/Music/src/com/android/music/MediaPlaybackActivity.java:876 — apps/Music/src/com/android/music/MediaPlaybackActivity.java:876-913 | apps/Music/src/com/android/music/MediaPlaybackActivity.java:915-952 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (53 corresponding lines) · ×2
  • Edited copy of a member (53 corresponding lines) apps/Music/src/com/android/music/AlbumBrowserActivity.java:299 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:299-351 | apps/Music/src/com/android/music/TrackBrowserActivity.java:681-744 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (53 corresponding lines) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2998 — apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2998-3065 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:3075-3127 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×2
  • Edited copy of a member (24 corresponding lines) apps/DeskClock/src/com/android/deskclock/timer/TimerObj.java:83 — apps/DeskClock/src/com/android/deskclock/timer/TimerObj.java:83-106 | apps/DeskClock/src/com/android/deskclock/timer/TimerObj.java:127-151 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) apps/Music/src/com/android/music/PlaylistBrowserActivity.java:411 — apps/Music/src/com/android/music/PlaylistBrowserActivity.java:411-435 | apps/Music/src/com/android/music/PlaylistBrowserActivity.java:437-460 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×2
  • Edited copy of a member (29 corresponding lines) apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:825 — apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:825-854 | apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:870-898 — 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) apps/Calendar/src/com/android/calendar/DayView.java:242 — apps/Calendar/src/com/android/calendar/DayView.java:242-270 | apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:186-214 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×2
  • Edited copy of a member (23 corresponding lines) apps/Calendar/src/com/android/calendar/EventInfoFragment.java:2190 — apps/Calendar/src/com/android/calendar/EventInfoFragment.java:2190-2223 | apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:684-706 — 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.
  • Edited copy of a member (23 corresponding lines) apps/DeskClock/src/com/android/deskclock/widget/ActionableToastBar.java:162 — apps/DeskClock/src/com/android/deskclock/widget/ActionableToastBar.java:162-188 | apps/DeskClock/src/com/android/deskclock/widget/ActionableToastBar.java:190-212 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×2
  • Edited copy of a member (27 corresponding lines) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:574 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:574-600 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:572-598 — 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) apps/Music/src/com/android/music/AlbumBrowserActivity.java:353 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:353-379 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:463-493 — 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 (15 corresponding lines) · ×2
  • Edited copy of a member (15 corresponding lines) apps/Calendar/src/com/android/ex/chips/BaseRecipientAdapter.java:550 — apps/Calendar/src/com/android/ex/chips/BaseRecipientAdapter.java:550-566 | apps/Calendar/src/com/android/ex/chips/RecipientAlternatesAdapter.java:338-352 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) apps/DeskClock/src/com/android/deskclock/widget/sgv/SgvAnimationHelper.java:115 — apps/DeskClock/src/com/android/deskclock/widget/sgv/SgvAnimationHelper.java:115-129 | apps/DeskClock/src/com/android/deskclock/widget/sgv/SgvAnimationHelper.java:136-151 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×2
  • Edited copy of a member (6 corresponding lines) apps/DeskClock/src/com/android/deskclock/provider/Alarm.java:195 — apps/DeskClock/src/com/android/deskclock/provider/Alarm.java:195-200 | apps/DeskClock/src/com/android/deskclock/provider/AlarmInstance.java:231-236 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) apps/DeskClock/src/com/android/deskclock/TimerSetupView.java:50 — apps/DeskClock/src/com/android/deskclock/TimerSetupView.java:50-56 | apps/DeskClock/src/com/android/deskclock/timer/TimerListItem.java:40-45 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (67 lines × 2) · ×2
  • Duplicated block (67 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:841 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:841-907 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:841-907 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (67 lines × 2) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:434 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:434-500 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:432-498 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (49 lines × 2) · ×2
  • Duplicated block (49 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:326 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:326-374 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:323-371 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (49 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:174 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:174-222 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:172-220 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×2
  • Duplicated block (43 lines × 2) apps/Calendar/src/com/android/calendarcommon2/RecurrenceSet.java:283 — apps/Calendar/src/com/android/calendarcommon2/RecurrenceSet.java:283-325 | apps/Calendar/src/com/android/calendarcommon2/RecurrenceSet.java:342-384 — 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 `apps/Calendar/src/com/android/calendarcommon2/RecurrenceSet.java:283` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (43 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:282 — apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:282-324 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:280-322 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 269 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 `apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:282` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×2
  • Duplicated block (40 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2102 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2102-2141 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2104-2143 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (40 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:265 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:265-304 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:262-301 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×2
  • Duplicated block (38 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2619 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2619-2656 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2621-2658 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (38 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:526 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:526-563 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:524-561 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×2
  • Duplicated block (36 lines × 2) apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:552 — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:552-587 | apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:550-585 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` and `apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 271 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (36 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:305 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:305-340 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:303-338 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:327 — apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:327-351 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:325-349 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (25 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:702 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:702-726 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:700-724 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×2
  • Duplicated block (10–12 lines × 2) apps/Calendar/src/com/android/calendar/alerts/AlarmScheduler.java:222 — apps/Calendar/src/com/android/calendar/alerts/AlarmScheduler.java:222-231 | apps/Calendar/src/com/android/calendar/alerts/AlarmScheduler.java:258-269 — 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 `apps/Calendar/src/com/android/calendar/alerts/AlarmScheduler.java:222` 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–12 lines × 2) apps/Music/src/com/android/music/AlbumBrowserActivity.java:464 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:464-473 | apps/Music/src/com/android/music/AlbumBrowserActivity.java:476-487 — 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 `apps/Music/src/com/android/music/AlbumBrowserActivity.java:476` 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.
D1 · Cyclomatic Complexity · RecurrenceProcessor.expand (cyclomatic 75) · ×1
  • RecurrenceProcessor.expand (cyclomatic 75) apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:735 — RecurrenceProcessor.expand has cyclomatic complexity 75 (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.
D1 · Cyclomatic Complexity · DayView.computeNeighbors (cyclomatic 65) · ×1
  • DayView.computeNeighbors (cyclomatic 65) apps/Calendar/src/com/android/calendar/DayView.java:3151 — DayView.computeNeighbors has cyclomatic complexity 65 (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.
D1 · Cyclomatic Complexity · QueryHandler.onQueryComplete (cyclomatic 60) · ×1
  • QueryHandler.onQueryComplete (cyclomatic 60) apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java:964 — QueryHandler.onQueryComplete has cyclomatic complexity 60 (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.
D1 · Cyclomatic Complexity · CalendarController.sendEvent (cyclomatic 60) · ×1
  • CalendarController.sendEvent (cyclomatic 60) apps/Calendar/src/com/android/calendar/CalendarController.java:432 — CalendarController.sendEvent has cyclomatic complexity 60 (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.
D1 · Cyclomatic Complexity · CalendarEventModel.checkOriginalModelFields (cyclomatic 58) · ×1
  • CalendarEventModel.checkOriginalModelFields (cyclomatic 58) apps/Calendar/src/com/android/calendar/CalendarEventModel.java:708 — CalendarEventModel.checkOriginalModelFields has cyclomatic complexity 58 (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.
D1 · Cyclomatic Complexity · EditEventHelper.saveEvent (cyclomatic 54) · ×1
  • EditEventHelper.saveEvent (cyclomatic 54) apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:268 — EditEventHelper.saveEvent has cyclomatic complexity 54 (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.
D1 · Cyclomatic Complexity · AlertService.processQuery (cyclomatic 43) · ×1
  • AlertService.processQuery (cyclomatic 43) apps/Calendar/src/com/android/calendar/alerts/AlertService.java:550 — AlertService.processQuery has cyclomatic complexity 43 (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.
D1 · Cyclomatic Complexity · AllInOneActivity.setMainPane (cyclomatic 41) · ×1
  • AllInOneActivity.setMainPane (cyclomatic 41) apps/Calendar/src/com/android/calendar/AllInOneActivity.java:849 — AllInOneActivity.setMainPane has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Utils.createDNAStrands (cyclomatic 39) · ×1
  • Utils.createDNAStrands (cyclomatic 39) apps/Calendar/src/com/android/calendar/Utils.java:924 — Utils.createDNAStrands has cyclomatic complexity 39 (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.
D1 · Cyclomatic Complexity · StaggeredGridView.layoutChildren (cyclomatic 37) · ×1
  • StaggeredGridView.layoutChildren (cyclomatic 37) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2218 — StaggeredGridView.layoutChildren has cyclomatic complexity 37 (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.
D1 · Cyclomatic Complexity · AllInOneActivity.handleEvent (cyclomatic 36) · ×1
  • AllInOneActivity.handleEvent (cyclomatic 36) apps/Calendar/src/com/android/calendar/AllInOneActivity.java:1088 — AllInOneActivity.handleEvent has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MediaPlaybackService.reloadQueue (cyclomatic 35) · ×1
  • MediaPlaybackService.reloadQueue (cyclomatic 35) apps/Music/src/com/android/music/MediaPlaybackService.java:493 — MediaPlaybackService.reloadQueue has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QueryHandler.onQueryComplete (cyclomatic 33) · ×1
  • QueryHandler.onQueryComplete (cyclomatic 33) apps/Calendar/src/com/android/calendar/EventInfoFragment.java:456 — QueryHandler.onQueryComplete has cyclomatic complexity 33 (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.
D1 · Cyclomatic Complexity · QueryHandler.onQueryComplete (cyclomatic 32) · ×1
  • QueryHandler.onQueryComplete (cyclomatic 32) apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:161 — QueryHandler.onQueryComplete has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CalendarEventModel.equals (cyclomatic 29) · ×1
  • CalendarEventModel.equals (cyclomatic 29) apps/Calendar/src/com/android/calendar/CalendarEventModel.java:531 — CalendarEventModel.equals has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CalendarEventModel.hashCode (cyclomatic 29) · ×1
  • CalendarEventModel.hashCode (cyclomatic 29) apps/Calendar/src/com/android/calendar/CalendarEventModel.java:482 — CalendarEventModel.hashCode has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DayView.onKeyDown (cyclomatic 29) · ×1
  • DayView.onKeyDown (cyclomatic 29) apps/Calendar/src/com/android/calendar/DayView.java:1510 — DayView.onKeyDown has cyclomatic complexity 29 (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.
D1 · Cyclomatic Complexity · EventInfoFragment.updateEvent (cyclomatic 29) · ×1
  • EventInfoFragment.updateEvent (cyclomatic 29) apps/Calendar/src/com/android/calendar/EventInfoFragment.java:1467 — EventInfoFragment.updateEvent has cyclomatic complexity 29 (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.
D1 · Cyclomatic Complexity · RecurrenceProcessor.filter (cyclomatic 29) · ×1
  • RecurrenceProcessor.filter (cyclomatic 29) apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:197 — RecurrenceProcessor.filter has cyclomatic complexity 29 (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.
D1 · Cyclomatic Complexity · TimeZoneData.loadTzsInZoneTab (cyclomatic 29) · ×1
  • TimeZoneData.loadTzsInZoneTab (cyclomatic 29) apps/Calendar/src/com/android/timezonepicker/TimeZoneData.java:316 — TimeZoneData.loadTzsInZoneTab has cyclomatic complexity 29 (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.
D1 · Cyclomatic Complexity · DayView.findSelectedEvent (cyclomatic 28) · ×1
  • DayView.findSelectedEvent (cyclomatic 28) apps/Calendar/src/com/android/calendar/DayView.java:4627 — DayView.findSelectedEvent has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GoogleCalendarUriIntentFilter.onCreate (cyclomatic 28) · ×1
  • GoogleCalendarUriIntentFilter.onCreate (cyclomatic 28) apps/Calendar/src/com/android/calendar/GoogleCalendarUriIntentFilter.java:137 — GoogleCalendarUriIntentFilter.onCreate has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CalendarEventModel.isUnchanged (cyclomatic 27) · ×1
  • CalendarEventModel.isUnchanged (cyclomatic 27) apps/Calendar/src/com/android/calendar/CalendarEventModel.java:624 — CalendarEventModel.isUnchanged has cyclomatic complexity 27 (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.
D1 · Cyclomatic Complexity · DaySet.generateDaysList (cyclomatic 26) · ×1
  • DaySet.generateDaysList (cyclomatic 26) apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:496 — DaySet.generateDaysList has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CountingTimerView.setTime (cyclomatic 26) · ×1
  • CountingTimerView.setTime (cyclomatic 26) apps/DeskClock/src/com/android/deskclock/timer/CountingTimerView.java:325 — CountingTimerView.setTime has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StaggeredGridView.fillDown (cyclomatic 26) · ×1
  • StaggeredGridView.fillDown (cyclomatic 26) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2665 — StaggeredGridView.fillDown has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TouchInterceptor.onTouchEvent (cyclomatic 26) · ×1
  • TouchInterceptor.onTouchEvent (cyclomatic 26) apps/Music/src/com/android/music/TouchInterceptor.java:298 — TouchInterceptor.onTouchEvent has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DayView.drawAllDayEvents (cyclomatic 25) · ×1
  • DayView.drawAllDayEvents (cyclomatic 25) apps/Calendar/src/com/android/calendar/DayView.java:2856 — DayView.drawAllDayEvents has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TimerReceiver.onReceive (cyclomatic 25) · ×1
  • TimerReceiver.onReceive (cyclomatic 25) apps/DeskClock/src/com/android/deskclock/timer/TimerReceiver.java:48 — TimerReceiver.onReceive has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StaggeredGridView.calculateLayoutStartOffsets (cyclomatic 25) · ×1
  • StaggeredGridView.calculateLayoutStartOffsets (cyclomatic 25) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2073 — StaggeredGridView.calculateLayoutStartOffsets has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StaggeredGridView.fillUp (cyclomatic 25) · ×1
  • StaggeredGridView.fillUp (cyclomatic 25) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2513 — StaggeredGridView.fillUp has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RecurrencePickerDialog.copyModelToEventRecurrence (cyclomatic 24) · ×1
  • RecurrencePickerDialog.copyModelToEventRecurrence (cyclomatic 24) apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:518 — RecurrencePickerDialog.copyModelToEventRecurrence has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Utils.findNanpMatchEnd (cyclomatic 24) · ×1
  • Utils.findNanpMatchEnd (cyclomatic 24) apps/Calendar/src/com/android/calendar/Utils.java:1987 — Utils.findNanpMatchEnd has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MediaPlaybackActivity.seekMethod1 (cyclomatic 24) · ×1
  • MediaPlaybackActivity.seekMethod1 (cyclomatic 24) apps/Music/src/com/android/music/MediaPlaybackActivity.java:699 — MediaPlaybackActivity.seekMethod1 has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RecurrencePickerDialog.copyEventRecurrenceToModel (cyclomatic 23) · ×1
  • RecurrencePickerDialog.copyEventRecurrenceToModel (cyclomatic 23) apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:417 — RecurrencePickerDialog.copyEventRecurrenceToModel has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DayView.onTouchEvent (cyclomatic 23) · ×1
  • DayView.onTouchEvent (cyclomatic 23) apps/Calendar/src/com/android/calendar/DayView.java:4236 — DayView.onTouchEvent has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RecipientAlternatesAdapter.getMatchingRecipients (cyclomatic 23) · ×1
  • RecipientAlternatesAdapter.getMatchingRecipients (cyclomatic 23) apps/Calendar/src/com/android/ex/chips/RecipientAlternatesAdapter.java:93 — RecipientAlternatesAdapter.getMatchingRecipients has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MediaPlaybackActivity.onLongClick (cyclomatic 23) · ×1
  • MediaPlaybackActivity.onLongClick (cyclomatic 23) apps/Music/src/com/android/music/MediaPlaybackActivity.java:263 — MediaPlaybackActivity.onLongClick has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MediaPlaybackService.getNextPosition (cyclomatic 23) · ×1
  • MediaPlaybackService.getNextPosition (cyclomatic 23) apps/Music/src/com/android/music/MediaPlaybackService.java:1351 — MediaPlaybackService.getNextPosition has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 1.handleMessage (cyclomatic 23) · ×1
  • 1.handleMessage (cyclomatic 23) apps/Music/src/com/android/music/MediaPlaybackService.java:174 — 1.handleMessage has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AlertReceiver.buildBasicNotification (cyclomatic 22) · ×1
  • AlertReceiver.buildBasicNotification (cyclomatic 22) apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:268 — AlertReceiver.buildBasicNotification has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EditEventView.setModel (cyclomatic 22) · ×1
  • EditEventView.setModel (cyclomatic 22) apps/Calendar/src/com/android/calendar/event/EditEventView.java:1054 — EditEventView.setModel 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.
D1 · Cyclomatic Complexity · EventInfo.equals (cyclomatic 22) · ×1
  • EventInfo.equals (cyclomatic 22) apps/Calendar/src/com/android/calendar/widget/CalendarAppWidgetModel.java:141 — EventInfo.equals 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.
D1 · Cyclomatic Complexity · BaseEmailAddressAdapter.onDirectoryLoadFinished (cyclomatic 22) · ×1
  • BaseEmailAddressAdapter.onDirectoryLoadFinished (cyclomatic 22) apps/Calendar/src/com/android/common/contacts/BaseEmailAddressAdapter.java:368 — BaseEmailAddressAdapter.onDirectoryLoadFinished has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SortCursor.onMove (cyclomatic 22) · ×1
  • SortCursor.onMove (cyclomatic 22) apps/Music/src/com/android/music/SortCursor.java:104 — SortCursor.onMove has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VerticalTextSpinner.onDraw (cyclomatic 22) · ×1
  • VerticalTextSpinner.onDraw (cyclomatic 22) apps/Music/src/com/android/music/VerticalTextSpinner.java:259 — VerticalTextSpinner.onDraw has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgendaWindowAdapter.getView (cyclomatic 21) · ×1
  • AgendaWindowAdapter.getView (cyclomatic 21) apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java:451 — AgendaWindowAdapter.getView has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Done.run (cyclomatic 21) · ×1
  • Done.run (cyclomatic 21) apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:790 — Done.run has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AsyncQueryServiceHelper.onHandleIntent (cyclomatic 21) · ×1
  • AsyncQueryServiceHelper.onHandleIntent (cyclomatic 21) apps/Calendar/src/com/android/calendar/AsyncQueryServiceHelper.java:243 — AsyncQueryServiceHelper.onHandleIntent has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · StickyHeaderListView.updateStickyHeader (cyclomatic 21) · ×1
  • StickyHeaderListView.updateStickyHeader (cyclomatic 21) apps/Calendar/src/com/android/calendar/StickyHeaderListView.java:254 — StickyHeaderListView.updateStickyHeader has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArrayFilter.performFiltering (cyclomatic 21) · ×1
  • ArrayFilter.performFiltering (cyclomatic 21) apps/Calendar/src/com/android/timezonepicker/TimeZoneFilterTypeAdapter.java:170 — ArrayFilter.performFiltering has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GlowPadView.handleMove (cyclomatic 21) · ×1
  • GlowPadView.handleMove (cyclomatic 21) apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:827 — GlowPadView.handleMove has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MediaButtonIntentReceiver.onReceive (cyclomatic 21) · ×1
  • MediaButtonIntentReceiver.onReceive (cyclomatic 21) apps/Music/src/com/android/music/MediaButtonIntentReceiver.java:59 — MediaButtonIntentReceiver.onReceive has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AttendeesView.addOneAttendee (cyclomatic 20) · ×1
  • AttendeesView.addOneAttendee (cyclomatic 20) apps/Calendar/src/com/android/calendar/event/AttendeesView.java:280 — AttendeesView.addOneAttendee 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.
D1 · Cyclomatic Complexity · SimpleWeekView.setWeekParams (cyclomatic 20) · ×1
  • SimpleWeekView.setWeekParams (cyclomatic 20) apps/Calendar/src/com/android/calendar/month/SimpleWeekView.java:212 — SimpleWeekView.setWeekParams has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RecurrencePickerDialog.onCreateView (cyclomatic 20) · ×1
  • RecurrencePickerDialog.onCreateView (cyclomatic 20) apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:618 — RecurrencePickerDialog.onCreateView 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.
D1 · Cyclomatic Complexity · RecurrenceProcessor.getLastOccurence (cyclomatic 20) · ×1
  • RecurrenceProcessor.getLastOccurence (cyclomatic 20) apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:84 — RecurrenceProcessor.getLastOccurence 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.
D1 · Cyclomatic Complexity · CalculatorEditable.internalReplace (cyclomatic 19) · ×1
  • CalculatorEditable.internalReplace (cyclomatic 19) apps/Calculator/src/com/android/calculator2/CalculatorEditable.java:49 — CalculatorEditable.internalReplace has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgendaByDayAdapter.findEventPositionNearestTime (cyclomatic 19) · ×1
  • AgendaByDayAdapter.findEventPositionNearestTime (cyclomatic 19) apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:508 — AgendaByDayAdapter.findEventPositionNearestTime has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RecurrencePickerDialog.updateDialog (cyclomatic 19) · ×1
  • RecurrencePickerDialog.updateDialog (cyclomatic 19) apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:913 — RecurrencePickerDialog.updateDialog has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AllInOneActivity.onCreate (cyclomatic 19) · ×1
  • AllInOneActivity.onCreate (cyclomatic 19) apps/Calendar/src/com/android/calendar/AllInOneActivity.java:304 — AllInOneActivity.onCreate has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DayView.doScroll (cyclomatic 19) · ×1
  • DayView.doScroll (cyclomatic 19) apps/Calendar/src/com/android/calendar/DayView.java:3970 — DayView.doScroll has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DayView.doSingleTapUp (cyclomatic 19) · ×1
  • DayView.doSingleTapUp (cyclomatic 19) apps/Calendar/src/com/android/calendar/DayView.java:3856 — DayView.doSingleTapUp has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GoogleCalendarUriIntentFilter.extractEidAndEmail (cyclomatic 19) · ×1
  • GoogleCalendarUriIntentFilter.extractEidAndEmail (cyclomatic 19) apps/Calendar/src/com/android/calendar/GoogleCalendarUriIntentFilter.java:69 — GoogleCalendarUriIntentFilter.extractEidAndEmail has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Tweener.to (cyclomatic 19) · ×1
  • Tweener.to (cyclomatic 19) apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/Tweener.java:57 — Tweener.to has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StaggeredGridView.addUpdateViewPositionsAnimators (cyclomatic 19) · ×1
  • StaggeredGridView.addUpdateViewPositionsAnimators (cyclomatic 19) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:1901 — StaggeredGridView.addUpdateViewPositionsAnimators has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrackBrowserActivity.setTitle (cyclomatic 19) · ×1
  • TrackBrowserActivity.setTitle (cyclomatic 19) apps/Music/src/com/android/music/TrackBrowserActivity.java:440 — TrackBrowserActivity.setTitle has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgendaAdapter.bindView (cyclomatic 18) · ×1
  • AgendaAdapter.bindView (cyclomatic 18) apps/Calendar/src/com/android/calendar/agenda/AgendaAdapter.java:108 — AgendaAdapter.bindView 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.
D1 · Cyclomatic Complexity · AgendaByDayAdapter.calculateDays (cyclomatic 18) · ×1
  • AgendaByDayAdapter.calculateDays (cyclomatic 18) apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:298 — AgendaByDayAdapter.calculateDays has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AlarmScheduler.queryNextReminderAndSchedule (cyclomatic 18) · ×1
  • AlarmScheduler.queryNextReminderAndSchedule (cyclomatic 18) apps/Calendar/src/com/android/calendar/alerts/AlarmScheduler.java:176 — AlarmScheduler.queryNextReminderAndSchedule has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DayView.sendAccessibilityEventAsNeeded (cyclomatic 18) · ×1
  • DayView.sendAccessibilityEventAsNeeded (cyclomatic 18) apps/Calendar/src/com/android/calendar/DayView.java:1692 — DayView.sendAccessibilityEventAsNeeded has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EventInfoActivity.onCreate (cyclomatic 18) · ×1
  • EventInfoActivity.onCreate (cyclomatic 18) apps/Calendar/src/com/android/calendar/EventInfoActivity.java:69 — EventInfoActivity.onCreate has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EventInfoFragment.updateCalendar (cyclomatic 18) · ×1
  • EventInfoFragment.updateCalendar (cyclomatic 18) apps/Calendar/src/com/android/calendar/EventInfoFragment.java:1744 — EventInfoFragment.updateCalendar has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QueryBrowserActivity.onServiceConnected (cyclomatic 18) · ×1
  • QueryBrowserActivity.onServiceConnected (cyclomatic 18) apps/Music/src/com/android/music/QueryBrowserActivity.java:89 — QueryBrowserActivity.onServiceConnected has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrackBrowserActivity.getTrackCursor (cyclomatic 18) · ×1
  • TrackBrowserActivity.getTrackCursor (cyclomatic 18) apps/Music/src/com/android/music/TrackBrowserActivity.java:1007 — TrackBrowserActivity.getTrackCursor has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgendaByDayAdapter.getView (cyclomatic 17) · ×1
  • AgendaByDayAdapter.getView (cyclomatic 17) apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:177 — AgendaByDayAdapter.getView 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.
D1 · Cyclomatic Complexity · MonthWeekEventsView.drawEvent (cyclomatic 17) · ×1
  • MonthWeekEventsView.drawEvent (cyclomatic 17) apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:822 — MonthWeekEventsView.drawEvent 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.
D1 · Cyclomatic Complexity · RecurrencePickerDialog.canHandleRecurrenceRule (cyclomatic 17) · ×1
  • RecurrencePickerDialog.canHandleRecurrenceRule (cyclomatic 17) apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:360 — RecurrencePickerDialog.canHandleRecurrenceRule 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.
D1 · Cyclomatic Complexity · CalendarFactory.getViewAt (cyclomatic 17) · ×1
  • CalendarFactory.getViewAt (cyclomatic 17) apps/Calendar/src/com/android/calendar/widget/CalendarAppWidgetService.java:208 — CalendarFactory.getViewAt 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.
D1 · Cyclomatic Complexity · DayView.remeasure (cyclomatic 17) · ×1
  • DayView.remeasure (cyclomatic 17) apps/Calendar/src/com/android/calendar/DayView.java:1241 — DayView.remeasure 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.
D1 · Cyclomatic Complexity · Utils.extendedLinkify (cyclomatic 17) · ×1
  • Utils.extendedLinkify (cyclomatic 17) apps/Calendar/src/com/android/calendar/Utils.java:1770 — Utils.extendedLinkify 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.
D1 · Cyclomatic Complexity · RecipientAlternatesAdapter.getBetterRecipient (cyclomatic 17) · ×1
  • RecipientAlternatesAdapter.getBetterRecipient (cyclomatic 17) apps/Calendar/src/com/android/ex/chips/RecipientAlternatesAdapter.java:263 — RecipientAlternatesAdapter.getBetterRecipient has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · TimeZoneResultAdapter.onSetFilter (cyclomatic 17) · ×1
  • TimeZoneResultAdapter.onSetFilter (cyclomatic 17) apps/Calendar/src/com/android/timezonepicker/TimeZoneResultAdapter.java:122 — TimeZoneResultAdapter.onSetFilter 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.
D1 · Cyclomatic Complexity · StaggeredGridView.populate (cyclomatic 17) · ×1
  • StaggeredGridView.populate (cyclomatic 17) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:1576 — StaggeredGridView.populate 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.
D1 · Cyclomatic Complexity · StaggeredGridView.recycleOffscreenViews (cyclomatic 17) · ×1
  • StaggeredGridView.recycleOffscreenViews (cyclomatic 17) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:1241 — StaggeredGridView.recycleOffscreenViews 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.
D1 · Cyclomatic Complexity · QueryListAdapter.bindView (cyclomatic 17) · ×1
  • QueryListAdapter.bindView (cyclomatic 17) apps/Music/src/com/android/music/QueryBrowserActivity.java:377 — QueryListAdapter.bindView 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.
D1 · Cyclomatic Complexity · EventListener.onKey (cyclomatic 16) · ×1
  • EventListener.onKey (cyclomatic 16) apps/Calculator/src/com/android/calculator2/EventListener.java:77 — EventListener.onKey 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.
D1 · Cyclomatic Complexity · AgendaWindowAdapter.refresh (cyclomatic 16) · ×1
  • AgendaWindowAdapter.refresh (cyclomatic 16) apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java:685 — AgendaWindowAdapter.refresh has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AlertReceiver.createEmailIntent (cyclomatic 16) · ×1
  • AlertReceiver.createEmailIntent (cyclomatic 16) apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:673 — AlertReceiver.createEmailIntent 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.
D1 · Cyclomatic Complexity · EditEventHelper.offsetStartTimeIfNecessary (cyclomatic 16) · ×1
  • EditEventHelper.offsetStartTimeIfNecessary (cyclomatic 16) apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:1306 — EditEventHelper.offsetStartTimeIfNecessary has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MonthByWeekAdapter.setEvents (cyclomatic 16) · ×1
  • MonthByWeekAdapter.setEvents (cyclomatic 16) apps/Calendar/src/com/android/calendar/month/MonthByWeekAdapter.java:130 — MonthByWeekAdapter.setEvents has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SimpleDayPickerFragment.goTo (cyclomatic 16) · ×1
  • SimpleDayPickerFragment.goTo (cyclomatic 16) apps/Calendar/src/com/android/calendar/month/SimpleDayPickerFragment.java:378 — SimpleDayPickerFragment.goTo 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.
D1 · Cyclomatic Complexity · AllInOneActivity.initFragments (cyclomatic 16) · ×1
  • AllInOneActivity.initFragments (cyclomatic 16) apps/Calendar/src/com/android/calendar/AllInOneActivity.java:621 — AllInOneActivity.initFragments has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EventRecurrenceFormatter.getRepeatString (cyclomatic 16) · ×1
  • EventRecurrenceFormatter.getRepeatString (cyclomatic 16) apps/Calendar/src/com/android/calendar/EventRecurrenceFormatter.java:35 — EventRecurrenceFormatter.getRepeatString has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Duration.parse (cyclomatic 16) · ×1
  • Duration.parse (cyclomatic 16) apps/Calendar/src/com/android/calendarcommon2/Duration.java:49 — Duration.parse 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.
D1 · Cyclomatic Complexity · ICalendar.extractParameter (cyclomatic 16) · ×1
  • ICalendar.extractParameter (cyclomatic 16) apps/Calendar/src/com/android/calendarcommon2/ICalendar.java:543 — ICalendar.extractParameter has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AlarmStateManager.registerInstance (cyclomatic 16) · ×1
  • AlarmStateManager.registerInstance (cyclomatic 16) apps/DeskClock/src/com/android/deskclock/alarms/AlarmStateManager.java:505 — AlarmStateManager.registerInstance has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StopwatchService.onStartCommand (cyclomatic 16) · ×1
  • StopwatchService.onStartCommand (cyclomatic 16) apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchService.java:52 — StopwatchService.onStartCommand 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.
D16 · Bus Factor · bus factor 1 · ×1
  • bus factor 1 — one contributor carries this repository — 3 contributor(s) have commits in this repository (automation and bot accounts excluded), but the commits of a single one of them cover most of its history — 90% of the 79 commit(s) sampled — so the number of people who actually carry it is 1. This is not the ambient state of a solo project: there ARE other contributors, and if the one who carries the repository becomes unavailable, the knowledge behind most of its history goes with them. Spread the next changes deliberately — have a second contributor review or pair on them — and write down the parts only one person can currently change.
D17 · Explicit Debt · FixmeComment · ×1
  • FixmeComment apps/Music/src/com/android/music/MediaPlaybackService.java:857 — // FIXME: shrink the array when the needed size is much smaller — 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.
D2 · Cognitive Complexity · RecurrenceProcessor.expand (cognitive 234) · ×1
  • RecurrenceProcessor.expand (cognitive 234) apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:735 — RecurrenceProcessor.expand has cognitive complexity 234 (threshold 15). Drivers by points: if/else 39 (172 pts), loops 7 (23 pts), ternaries 4 (21 pts), boolean chains 12, match/switch 2 (4 pts), error handling 2 (nesting depth added 168). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DayView.computeNeighbors (cognitive 154) · ×1
  • DayView.computeNeighbors (cognitive 154) apps/Calendar/src/com/android/calendar/DayView.java:3151 — DayView.computeNeighbors has cognitive complexity 154 (threshold 15). Drivers by points: if/else 57 (144 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 88). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · QueryHandler.onQueryComplete (cognitive 119) · ×1
  • QueryHandler.onQueryComplete (cognitive 119) apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java:964 — QueryHandler.onQueryComplete has cognitive complexity 119 (threshold 15). Drivers by points: if/else 44 (94 pts), boolean chains 12, loops 5 (11 pts), match/switch 1 (2 pts) (nesting depth added 57). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GoogleCalendarUriIntentFilter.onCreate (cognitive 116) · ×1
  • GoogleCalendarUriIntentFilter.onCreate (cognitive 116) apps/Calendar/src/com/android/calendar/GoogleCalendarUriIntentFilter.java:137 — GoogleCalendarUriIntentFilter.onCreate has cognitive complexity 116 (threshold 15). Drivers by points: if/else 21 (91 pts), error handling 3 (14 pts), match/switch 1 (6 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 89). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · EditEventHelper.saveEvent (cognitive 107) · ×1
  • EditEventHelper.saveEvent (cognitive 107) apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:268 — EditEventHelper.saveEvent has cognitive complexity 107 (threshold 15). Drivers by points: if/else 45 (78 pts), loops 3 (13 pts), boolean chains 10, ternaries 3 (6 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CalendarController.sendEvent (cognitive 94) · ×1
  • CalendarController.sendEvent (cognitive 94) apps/Calendar/src/com/android/calendar/CalendarController.java:432 — CalendarController.sendEvent has cognitive complexity 94 (threshold 15). Drivers by points: if/else 39 (59 pts), ternaries 9 (18 pts), boolean chains 10, loops 3 (7 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Utils.createDNAStrands (cognitive 94) · ×1
  • Utils.createDNAStrands (cognitive 94) apps/Calendar/src/com/android/calendar/Utils.java:924 — Utils.createDNAStrands has cognitive complexity 94 (threshold 15). Drivers by points: if/else 28 (80 pts), boolean chains 7, loops 3 (7 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DaySet.generateDaysList (cognitive 93) · ×1
  • DaySet.generateDaysList (cognitive 93) apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:496 — DaySet.generateDaysList has cognitive complexity 93 (threshold 15). Drivers by points: if/else 21 (66 pts), loops 7 (26 pts), boolean chains 1 (nesting depth added 64). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AlertService.processQuery (cognitive 83) · ×1
  • AlertService.processQuery (cognitive 83) apps/Calendar/src/com/android/calendar/alerts/AlertService.java:550 — AlertService.processQuery has cognitive complexity 83 (threshold 15). Drivers by points: if/else 31 (68 pts), boolean chains 14, loops 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaggeredGridView.layoutChildren (cognitive 81) · ×1
  • StaggeredGridView.layoutChildren (cognitive 81) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2218 — StaggeredGridView.layoutChildren has cognitive complexity 81 (threshold 15). Drivers by points: if/else 27 (58 pts), ternaries 3 (9 pts), boolean chains 8, loops 3 (6 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaPlaybackService.reloadQueue (cognitive 76) · ×1
  • MediaPlaybackService.reloadQueue (cognitive 76) apps/Music/src/com/android/music/MediaPlaybackService.java:493 — MediaPlaybackService.reloadQueue has cognitive complexity 76 (threshold 15). Drivers by points: if/else 24 (55 pts), boolean chains 9, loops 2 (6 pts), ternaries 3 (6 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AllInOneActivity.handleEvent (cognitive 70) · ×1
  • AllInOneActivity.handleEvent (cognitive 70) apps/Calendar/src/com/android/calendar/AllInOneActivity.java:1088 — AllInOneActivity.handleEvent has cognitive complexity 70 (threshold 15). Drivers by points: if/else 24 (52 pts), boolean chains 13, ternaries 2 (5 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CalendarEventModel.checkOriginalModelFields (cognitive 69) · ×1
  • CalendarEventModel.checkOriginalModelFields (cognitive 69) apps/Calendar/src/com/android/calendar/CalendarEventModel.java:708 — CalendarEventModel.checkOriginalModelFields has cognitive complexity 69 (threshold 15). Drivers by points: if/else 57 (69 pts) (nesting depth added 12). 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.
D2 · Cognitive Complexity · TimeZoneData.loadTzsInZoneTab (cognitive 67) · ×1
  • TimeZoneData.loadTzsInZoneTab (cognitive 67) apps/Calendar/src/com/android/timezonepicker/TimeZoneData.java:316 — TimeZoneData.loadTzsInZoneTab has cognitive complexity 67 (threshold 15). Drivers by points: if/else 19 (57 pts), boolean chains 4, error handling 4, loops 2 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TouchInterceptor.onTouchEvent (cognitive 65) · ×1
  • TouchInterceptor.onTouchEvent (cognitive 65) apps/Music/src/com/android/music/TouchInterceptor.java:298 — TouchInterceptor.onTouchEvent has cognitive complexity 65 (threshold 15). Drivers by points: if/else 15 (46 pts), ternaries 2 (11 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 41). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · QueryHandler.onQueryComplete (cognitive 62) · ×1
  • QueryHandler.onQueryComplete (cognitive 62) apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:161 — QueryHandler.onQueryComplete has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (48 pts), loops 3 (7 pts), boolean chains 6, match/switch 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgendaByDayAdapter.calculateDays (cognitive 61) · ×1
  • AgendaByDayAdapter.calculateDays (cognitive 61) apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:298 — AgendaByDayAdapter.calculateDays has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (36 pts), loops 5 (15 pts), ternaries 2 (10 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DayView.findSelectedEvent (cognitive 61) · ×1
  • DayView.findSelectedEvent (cognitive 61) apps/Calendar/src/com/android/calendar/DayView.java:4627 — DayView.findSelectedEvent has cognitive complexity 61 (threshold 15). Drivers by points: if/else 20 (46 pts), boolean chains 6, loops 3 (5 pts), ternaries 1 (4 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RecurrenceProcessor.filter (cognitive 61) · ×1
  • RecurrenceProcessor.filter (cognitive 61) apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:197 — RecurrenceProcessor.filter has cognitive complexity 61 (threshold 15). Drivers by points: if/else 25 (54 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AllInOneActivity.setMainPane (cognitive 55) · ×1
  • AllInOneActivity.setMainPane (cognitive 55) apps/Calendar/src/com/android/calendar/AllInOneActivity.java:849 — AllInOneActivity.setMainPane has cognitive complexity 55 (threshold 15). Drivers by points: if/else 31 (47 pts), boolean chains 7, match/switch 1 (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.
D2 · Cognitive Complexity · QueryHandler.onQueryComplete (cognitive 54) · ×1
  • QueryHandler.onQueryComplete (cognitive 54) apps/Calendar/src/com/android/calendar/EventInfoFragment.java:456 — QueryHandler.onQueryComplete has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (41 pts), loops 2 (5 pts), boolean chains 4, ternaries 1 (3 pts), match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaggeredGridView.calculateLayoutStartOffsets (cognitive 54) · ×1
  • StaggeredGridView.calculateLayoutStartOffsets (cognitive 54) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2073 — StaggeredGridView.calculateLayoutStartOffsets has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 6 (12 pts), ternaries 2 (7 pts), boolean chains 3 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EventInfoFragment.updateEvent (cognitive 52) · ×1
  • EventInfoFragment.updateEvent (cognitive 52) apps/Calendar/src/com/android/calendar/EventInfoFragment.java:1467 — EventInfoFragment.updateEvent has cognitive complexity 52 (threshold 15). Drivers by points: if/else 24 (39 pts), error handling 2 (7 pts), boolean chains 6 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecipientAlternatesAdapter.getMatchingRecipients (cognitive 52) · ×1
  • RecipientAlternatesAdapter.getMatchingRecipients (cognitive 52) apps/Calendar/src/com/android/ex/chips/RecipientAlternatesAdapter.java:93 — RecipientAlternatesAdapter.getMatchingRecipients has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 6 (18 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VerticalTextSpinner.onDraw (cognitive 52) · ×1
  • VerticalTextSpinner.onDraw (cognitive 52) apps/Music/src/com/android/music/VerticalTextSpinner.java:259 — VerticalTextSpinner.onDraw has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (48 pts), boolean chains 4 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · StaggeredGridView.fillDown (cognitive 49) · ×1
  • StaggeredGridView.fillDown (cognitive 49) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2665 — StaggeredGridView.fillDown has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (29 pts), ternaries 3 (8 pts), boolean chains 6, loops 4 (6 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaggeredGridView.fillUp (cognitive 47) · ×1
  • StaggeredGridView.fillUp (cognitive 47) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2513 — StaggeredGridView.fillUp has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 6, loops 4 (6 pts), ternaries 2 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DayView.sendAccessibilityEventAsNeeded (cognitive 46) · ×1
  • DayView.sendAccessibilityEventAsNeeded (cognitive 46) apps/Calendar/src/com/android/calendar/DayView.java:1692 — DayView.sendAccessibilityEventAsNeeded has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 1 (5 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · StickyHeaderListView.updateStickyHeader (cognitive 45) · ×1
  • StickyHeaderListView.updateStickyHeader (cognitive 45) apps/Calendar/src/com/android/calendar/StickyHeaderListView.java:254 — StickyHeaderListView.updateStickyHeader has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (39 pts), boolean chains 6 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BaseEmailAddressAdapter.onDirectoryLoadFinished (cognitive 44) · ×1
  • BaseEmailAddressAdapter.onDirectoryLoadFinished (cognitive 44) apps/Calendar/src/com/android/common/contacts/BaseEmailAddressAdapter.java:368 — BaseEmailAddressAdapter.onDirectoryLoadFinished has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 4 (6 pts), error handling 1 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlarmScheduler.queryNextReminderAndSchedule (cognitive 43) · ×1
  • AlarmScheduler.queryNextReminderAndSchedule (cognitive 43) apps/Calendar/src/com/android/calendar/alerts/AlarmScheduler.java:176 — AlarmScheduler.queryNextReminderAndSchedule has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaPlaybackService.getNextPosition (cognitive 43) · ×1
  • MediaPlaybackService.getNextPosition (cognitive 43) apps/Music/src/com/android/music/MediaPlaybackService.java:1351 — MediaPlaybackService.getNextPosition has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 5 (13 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecurrencePickerDialog.copyModelToEventRecurrence (cognitive 42) · ×1
  • RecurrencePickerDialog.copyModelToEventRecurrence (cognitive 42) apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:518 — RecurrencePickerDialog.copyModelToEventRecurrence has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (33 pts), loops 2 (4 pts), boolean chains 3, match/switch 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DayView.drawAllDayEvents (cognitive 41) · ×1
  • DayView.drawAllDayEvents (cognitive 41) apps/Calendar/src/com/android/calendar/DayView.java:2856 — DayView.drawAllDayEvents has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 5, loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrackBrowserActivity.setTitle (cognitive 41) · ×1
  • TrackBrowserActivity.setTitle (cognitive 41) apps/Music/src/com/android/music/TrackBrowserActivity.java:440 — TrackBrowserActivity.setTitle has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (38 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DayView.onKeyDown (cognitive 40) · ×1
  • DayView.onKeyDown (cognitive 40) apps/Calendar/src/com/android/calendar/DayView.java:1510 — DayView.onKeyDown has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (37 pts), boolean chains 2, match/switch 1 (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.
D2 · Cognitive Complexity · DayView.onTouchEvent (cognitive 40) · ×1
  • DayView.onTouchEvent (cognitive 40) apps/Calendar/src/com/android/calendar/DayView.java:4236 — DayView.onTouchEvent has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 1, match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CountingTimerView.setTime (cognitive 40) · ×1
  • CountingTimerView.setTime (cognitive 40) apps/DeskClock/src/com/android/deskclock/timer/CountingTimerView.java:325 — CountingTimerView.setTime has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (26 pts), ternaries 4 (8 pts), boolean chains 6 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GlowPadView.handleMove (cognitive 39) · ×1
  • GlowPadView.handleMove (cognitive 39) apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/GlowPadView.java:827 — GlowPadView.handleMove has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (25 pts), ternaries 3 (6 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaggeredGridView.recycleOffscreenViews (cognitive 39) · ×1
  • StaggeredGridView.recycleOffscreenViews (cognitive 39) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:1241 — StaggeredGridView.recycleOffscreenViews has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 5 (9 pts), ternaries 1 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgendaByDayAdapter.findEventPositionNearestTime (cognitive 37) · ×1
  • AgendaByDayAdapter.findEventPositionNearestTime (cognitive 37) apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:508 — AgendaByDayAdapter.findEventPositionNearestTime has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · EventInfoFragment.initAttendeesCursor (cognitive 37) · ×1
  • EventInfoFragment.initAttendeesCursor (cognitive 37) apps/Calendar/src/com/android/calendar/EventInfoFragment.java:1075 — EventInfoFragment.initAttendeesCursor has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (28 pts), match/switch 1 (5 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ICalendar.extractParameter (cognitive 37) · ×1
  • ICalendar.extractParameter (cognitive 37) apps/Calendar/src/com/android/calendarcommon2/ICalendar.java:543 — ICalendar.extractParameter has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (35 pts), boolean chains 1, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecurrenceProcessor.getLastOccurence (cognitive 37) · ×1
  • RecurrenceProcessor.getLastOccurence (cognitive 37) apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:84 — RecurrenceProcessor.getLastOccurence has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (7 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EllipsizeLayout.onMeasure (cognitive 37) · ×1
  • EllipsizeLayout.onMeasure (cognitive 37) apps/DeskClock/src/com/android/deskclock/widget/EllipsizeLayout.java:62 — EllipsizeLayout.onMeasure has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (30 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AgendaWindowAdapter.refresh (cognitive 36) · ×1
  • AgendaWindowAdapter.refresh (cognitive 36) apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java:685 — AgendaWindowAdapter.refresh has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (28 pts), ternaries 3 (6 pts), boolean chains 2 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DayView.doScroll (cognitive 36) · ×1
  • DayView.doScroll (cognitive 36) apps/Calendar/src/com/android/calendar/DayView.java:3970 — DayView.doScroll has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (30 pts), ternaries 2 (6 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QueryBrowserActivity.onServiceConnected (cognitive 36) · ×1
  • QueryBrowserActivity.onServiceConnected (cognitive 36) apps/Music/src/com/android/music/QueryBrowserActivity.java:89 — QueryBrowserActivity.onServiceConnected has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 1, ternaries 1 (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.
D2 · Cognitive Complexity · SortCursor.onMove (cognitive 36) · ×1
  • SortCursor.onMove (cognitive 36) apps/Music/src/com/android/music/SortCursor.java:104 — SortCursor.onMove has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 5 (8 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AsyncQueryServiceHelper.onHandleIntent (cognitive 35) · ×1
  • AsyncQueryServiceHelper.onHandleIntent (cognitive 35) apps/Calendar/src/com/android/calendar/AsyncQueryServiceHelper.java:243 — AsyncQueryServiceHelper.onHandleIntent has cognitive complexity 35 (threshold 15). Drivers by points: error handling 5 (16 pts), if/else 9 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrackBrowserActivity.getTrackCursor (cognitive 35) · ×1
  • TrackBrowserActivity.getTrackCursor (cognitive 35) apps/Music/src/com/android/music/TrackBrowserActivity.java:1007 — TrackBrowserActivity.getTrackCursor has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · AgendaWindowAdapter.getView (cognitive 34) · ×1
  • AgendaWindowAdapter.getView (cognitive 34) apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java:451 — AgendaWindowAdapter.getView has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlertReceiver.buildBasicNotification (cognitive 34) · ×1
  • AlertReceiver.buildBasicNotification (cognitive 34) apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:268 — AlertReceiver.buildBasicNotification has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 9 (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.
D2 · Cognitive Complexity · CalendarFactory.getViewAt (cognitive 34) · ×1
  • CalendarFactory.getViewAt (cognitive 34) apps/Calendar/src/com/android/calendar/widget/CalendarAppWidgetService.java:208 — CalendarFactory.getViewAt has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CalendarEventModel.equals (cognitive 34) · ×1
  • CalendarEventModel.equals (cognitive 34) apps/Calendar/src/com/android/calendar/CalendarEventModel.java:531 — CalendarEventModel.equals has cognitive complexity 34 (threshold 15). Drivers by points: if/else 28 (34 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MediaButtonIntentReceiver.onReceive (cognitive 34) · ×1
  • MediaButtonIntentReceiver.onReceive (cognitive 34) apps/Music/src/com/android/music/MediaButtonIntentReceiver.java:59 — MediaButtonIntentReceiver.onReceive has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RecurrencePickerDialog.copyEventRecurrenceToModel (cognitive 33) · ×1
  • RecurrencePickerDialog.copyEventRecurrenceToModel (cognitive 33) apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:417 — RecurrencePickerDialog.copyEventRecurrenceToModel has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecurrencePickerDialog.onCreateView (cognitive 33) · ×1
  • RecurrencePickerDialog.onCreateView (cognitive 33) apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:618 — RecurrencePickerDialog.onCreateView has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CalendarEventModel.isUnchanged (cognitive 33) · ×1
  • CalendarEventModel.isUnchanged (cognitive 33) apps/Calendar/src/com/android/calendar/CalendarEventModel.java:624 — CalendarEventModel.isUnchanged has cognitive complexity 33 (threshold 15). Drivers by points: if/else 22 (29 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Utils.findNanpMatchEnd (cognitive 33) · ×1
  • Utils.findNanpMatchEnd (cognitive 33) apps/Calendar/src/com/android/calendar/Utils.java:1987 — Utils.findNanpMatchEnd has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 11, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayFilter.performFiltering (cognitive 33) · ×1
  • ArrayFilter.performFiltering (cognitive 33) apps/Calendar/src/com/android/timezonepicker/TimeZoneFilterTypeAdapter.java:170 — ArrayFilter.performFiltering has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimerReceiver.onReceive (cognitive 33) · ×1
  • TimerReceiver.onReceive (cognitive 33) apps/DeskClock/src/com/android/deskclock/timer/TimerReceiver.java:48 — TimerReceiver.onReceive has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23 (30 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaggeredGridView.addUpdateViewPositionsAnimators (cognitive 33) · ×1
  • StaggeredGridView.addUpdateViewPositionsAnimators (cognitive 33) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:1901 — StaggeredGridView.addUpdateViewPositionsAnimators has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 2 (5 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaggeredGridView.getNextRecordDown (cognitive 33) · ×1
  • StaggeredGridView.getNextRecordDown (cognitive 33) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2912 — StaggeredGridView.getNextRecordDown has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 5 (11 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (StaggeredGridView.getNextRecordUp) 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.
D2 · Cognitive Complexity · StaggeredGridView.getNextRecordUp (cognitive 33) · ×1
  • StaggeredGridView.getNextRecordUp (cognitive 33) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2830 — StaggeredGridView.getNextRecordUp has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 5 (11 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (StaggeredGridView.getNextRecordDown) 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.
D2 · Cognitive Complexity · CalculatorEditable.internalReplace (cognitive 32) · ×1
  • CalculatorEditable.internalReplace (cognitive 32) apps/Calculator/src/com/android/calculator2/CalculatorEditable.java:49 — CalculatorEditable.internalReplace has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (7 pts), boolean chains 6, ternaries 2 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaPlaybackActivity.seekMethod1 (cognitive 32) · ×1
  • MediaPlaybackActivity.seekMethod1 (cognitive 32) apps/Music/src/com/android/music/MediaPlaybackActivity.java:699 — MediaPlaybackActivity.seekMethod1 has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 9, error handling 1 (4 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlertUtils.flushOldAlertsFromInternalStorage (cognitive 31) · ×1
  • AlertUtils.flushOldAlertsFromInternalStorage (cognitive 31) apps/Calendar/src/com/android/calendar/alerts/AlertUtils.java:270 — AlertUtils.flushOldAlertsFromInternalStorage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 1 (3 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AttendeesView.addOneAttendee (cognitive 31) · ×1
  • AttendeesView.addOneAttendee (cognitive 31) apps/Calendar/src/com/android/calendar/event/AttendeesView.java:280 — AttendeesView.addOneAttendee has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 6 (12 pts), boolean chains 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Done.run (cognitive 31) · ×1
  • Done.run (cognitive 31) apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:790 — Done.run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · EditEventView.setViewStates (cognitive 31) · ×1
  • EditEventView.setViewStates (cognitive 31) apps/Calendar/src/com/android/calendar/event/EditEventView.java:1397 — EditEventView.setViewStates has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 6 (12 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DayView.computeEventRelations (cognitive 31) · ×1
  • DayView.computeEventRelations (cognitive 31) apps/Calendar/src/com/android/calendar/DayView.java:2101 — DayView.computeEventRelations has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaPlaybackActivity.onTouch (cognitive 31) · ×1
  • MediaPlaybackActivity.onTouch (cognitive 31) apps/Music/src/com/android/music/MediaPlaybackActivity.java:174 — MediaPlaybackActivity.onTouch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 1.handleMessage (cognitive 31) · ×1
  • 1.handleMessage (cognitive 31) apps/Music/src/com/android/music/MediaPlaybackService.java:174 — 1.handleMessage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (26 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · EventInfoActivity.onCreate (cognitive 30) · ×1
  • EventInfoActivity.onCreate (cognitive 30) apps/Calendar/src/com/android/calendar/EventInfoActivity.java:69 — EventInfoActivity.onCreate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EventInfoFragment.updateCalendar (cognitive 30) · ×1
  • EventInfoFragment.updateCalendar (cognitive 30) apps/Calendar/src/com/android/calendar/EventInfoFragment.java:1744 — EventInfoFragment.updateCalendar has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 7, ternaries 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.
D2 · Cognitive Complexity · EventRecurrenceFormatter.getRepeatString (cognitive 30) · ×1
  • EventRecurrenceFormatter.getRepeatString (cognitive 30) apps/Calendar/src/com/android/calendar/EventRecurrenceFormatter.java:35 — EventRecurrenceFormatter.getRepeatString has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 1 (4 pts), error handling 1 (3 pts), match/switch 1, ternaries 1 (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.
D2 · Cognitive Complexity · GoogleCalendarUriIntentFilter.extractEidAndEmail (cognitive 30) · ×1
  • GoogleCalendarUriIntentFilter.extractEidAndEmail (cognitive 30) apps/Calendar/src/com/android/calendar/GoogleCalendarUriIntentFilter.java:69 — GoogleCalendarUriIntentFilter.extractEidAndEmail has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 1 (4 pts), boolean chains 1, error handling 1, loops 1 (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.
D2 · Cognitive Complexity · AgendaByDayAdapter.getView (cognitive 29) · ×1
  • AgendaByDayAdapter.getView (cognitive 29) apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:177 — AgendaByDayAdapter.getView has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimeZoneResultAdapter.onSetFilter (cognitive 29) · ×1
  • TimeZoneResultAdapter.onSetFilter (cognitive 29) apps/Calendar/src/com/android/timezonepicker/TimeZoneResultAdapter.java:122 — TimeZoneResultAdapter.onSetFilter has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaPlaybackActivity.onLongClick (cognitive 29) · ×1
  • MediaPlaybackActivity.onLongClick (cognitive 29) apps/Music/src/com/android/music/MediaPlaybackActivity.java:263 — MediaPlaybackActivity.onLongClick has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 7, error handling 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MediaPlaybackService.saveQueue (cognitive 29) · ×1
  • MediaPlaybackService.saveQueue (cognitive 29) apps/Music/src/com/android/music/MediaPlaybackService.java:427 — MediaPlaybackService.saveQueue has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (14 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.
D2 · Cognitive Complexity · MusicUtils.getArtwork (cognitive 29) · ×1
  • MusicUtils.getArtwork (cognitive 29) apps/Music/src/com/android/music/MusicUtils.java:993 — MusicUtils.getArtwork has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (24 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AlertReceiver.makeDigestNotification (cognitive 28) · ×1
  • AlertReceiver.makeDigestNotification (cognitive 28) apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:448 — AlertReceiver.makeDigestNotification has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MonthByWeekAdapter.setEvents (cognitive 28) · ×1
  • MonthByWeekAdapter.setEvents (cognitive 28) apps/Calendar/src/com/android/calendar/month/MonthByWeekAdapter.java:130 — MonthByWeekAdapter.setEvents has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CalendarEventModel.hashCode (cognitive 28) · ×1
  • CalendarEventModel.hashCode (cognitive 28) apps/Calendar/src/com/android/calendar/CalendarEventModel.java:482 — CalendarEventModel.hashCode has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 28. 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.
D2 · Cognitive Complexity · GroupingListAdapter.obtainPositionMetadata (cognitive 28) · ×1
  • GroupingListAdapter.obtainPositionMetadata (cognitive 28) apps/Calendar/src/com/android/common/widget/GroupingListAdapter.java:270 — GroupingListAdapter.obtainPositionMetadata has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RecipientTextWatcher.afterTextChanged (cognitive 28) · ×1
  • RecipientTextWatcher.afterTextChanged (cognitive 28) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2225 — RecipientTextWatcher.afterTextChanged has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgendaWindowAdapter.pruneAdapterInfo (cognitive 27) · ×1
  • AgendaWindowAdapter.pruneAdapterInfo (cognitive 27) apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java:764 — AgendaWindowAdapter.pruneAdapterInfo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MonthWeekEventsView.onHoverEvent (cognitive 27) · ×1
  • MonthWeekEventsView.onHoverEvent (cognitive 27) apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:1055 — MonthWeekEventsView.onHoverEvent has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 4, loops 1 (4 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SimpleWeekView.setWeekParams (cognitive 27) · ×1
  • SimpleWeekView.setWeekParams (cognitive 27) apps/Calendar/src/com/android/calendar/month/SimpleWeekView.java:212 — SimpleWeekView.setWeekParams has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (23 pts), ternaries 2, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OverScrollerSGV.computeScrollOffset (cognitive 27) · ×1
  • OverScrollerSGV.computeScrollOffset (cognitive 27) apps/DeskClock/src/com/android/deskclock/widget/sgv/OverScrollerSGV.java:294 — OverScrollerSGV.computeScrollOffset has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgendaAdapter.bindView (cognitive 26) · ×1
  • AgendaAdapter.bindView (cognitive 26) apps/Calendar/src/com/android/calendar/agenda/AgendaAdapter.java:108 — AgendaAdapter.bindView has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · EditEventView.setModel (cognitive 26) · ×1
  • EditEventView.setModel (cognitive 26) apps/Calendar/src/com/android/calendar/event/EditEventView.java:1054 — EditEventView.setModel has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23 (24 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RecurrencePickerDialog.updateDialog (cognitive 26) · ×1
  • RecurrencePickerDialog.updateDialog (cognitive 26) apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:913 — RecurrencePickerDialog.updateDialog has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 4 (6 pts), loops 1 (2 pts), 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.
D2 · Cognitive Complexity · AllInOneActivity.onCreate (cognitive 26) · ×1
  • AllInOneActivity.onCreate (cognitive 26) apps/Calendar/src/com/android/calendar/AllInOneActivity.java:304 — AllInOneActivity.onCreate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · DayView.doSingleTapUp (cognitive 26) · ×1
  • DayView.doSingleTapUp (cognitive 26) apps/Calendar/src/com/android/calendar/DayView.java:3856 — DayView.doSingleTapUp has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 7 (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.
D2 · Cognitive Complexity · Utils.extendedLinkify (cognitive 26) · ×1
  • Utils.extendedLinkify (cognitive 26) apps/Calendar/src/com/android/calendar/Utils.java:1770 — Utils.extendedLinkify has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecurrenceSet.init (cognitive 26) · ×1
  • RecurrenceSet.init (cognitive 26) apps/Calendar/src/com/android/calendarcommon2/RecurrenceSet.java:92 — RecurrenceSet.init has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (16 pts), if/else 5 (9 pts), boolean chains 1 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · RecipientEditTextView.handlePendingChips (cognitive 26) · ×1
  • RecipientEditTextView.handlePendingChips (cognitive 26) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:859 — RecipientEditTextView.handlePendingChips has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimeZoneData.loadTzs (cognitive 26) · ×1
  • TimeZoneData.loadTzs (cognitive 26) apps/Calendar/src/com/android/timezonepicker/TimeZoneData.java:120 — TimeZoneData.loadTzs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 5.startTransition (cognitive 26) · ×1
  • 5.startTransition (cognitive 26) apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchFragment.java:375 — 5.startTransition has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 2 (10 pts), loops 1 (3 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 1.run (cognitive 26) · ×1
  • 1.run (cognitive 26) apps/DeskClock/src/com/android/deskclock/timer/TimerFragment.java:387 — 1.run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 3, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaPlaybackService.openCurrentAndNext (cognitive 26) · ×1
  • MediaPlaybackService.openCurrentAndNext (cognitive 26) apps/Music/src/com/android/music/MediaPlaybackService.java:1038 — MediaPlaybackService.openCurrentAndNext has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EndSpinnerAdapter.getView (cognitive 25) · ×1
  • EndSpinnerAdapter.getView (cognitive 25) apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:1241 — EndSpinnerAdapter.getView has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 2, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DayView.switchViews (cognitive 25) · ×1
  • DayView.switchViews (cognitive 25) apps/Calendar/src/com/android/calendar/DayView.java:1399 — DayView.switchViews has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (25 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ArrayFilter.handleSearchByGmt (cognitive 25) · ×1
  • ArrayFilter.handleSearchByGmt (cognitive 25) apps/Calendar/src/com/android/timezonepicker/TimeZoneFilterTypeAdapter.java:304 — ArrayFilter.handleSearchByGmt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 1.performFiltering (cognitive 25) · ×1
  • 1.performFiltering (cognitive 25) apps/DeskClock/src/com/android/deskclock/worldclock/CitiesActivity.java:141 — 1.performFiltering has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaPlaybackActivity.onKeyUp (cognitive 25) · ×1
  • MediaPlaybackActivity.onKeyUp (cognitive 25) apps/Music/src/com/android/music/MediaPlaybackActivity.java:753 — MediaPlaybackActivity.onKeyUp has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 2, error handling 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.
D2 · Cognitive Complexity · EditEventView.setAllDayViewsVisibility (cognitive 24) · ×1
  • EditEventView.setAllDayViewsVisibility (cognitive 24) apps/Calendar/src/com/android/calendar/event/EditEventView.java:1641 — EditEventView.setAllDayViewsVisibility has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EventInfo.equals (cognitive 24) · ×1
  • EventInfo.equals (cognitive 24) apps/Calendar/src/com/android/calendar/widget/CalendarAppWidgetModel.java:141 — EventInfo.equals has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (24 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.
D2 · Cognitive Complexity · AllInOneActivity.initFragments (cognitive 24) · ×1
  • AllInOneActivity.initFragments (cognitive 24) apps/Calendar/src/com/android/calendar/AllInOneActivity.java:621 — AllInOneActivity.initFragments has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, error handling 1 (3 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.
D2 · Cognitive Complexity · EventRecurrence.parse (cognitive 24) · ×1
  • EventRecurrence.parse (cognitive 24) apps/Calendar/src/com/android/calendarcommon2/EventRecurrence.java:528 — EventRecurrence.parse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OperationScheduler.parseOptions (cognitive 24) · ×1
  • OperationScheduler.parseOptions (cognitive 24) apps/Calendar/src/com/android/common/OperationScheduler.java:108 — OperationScheduler.parseOptions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Rfc822Validator.fixText (cognitive 24) · ×1
  • Rfc822Validator.fixText (cognitive 24) apps/Calendar/src/com/android/common/Rfc822Validator.java:122 — Rfc822Validator.fixText has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecipientEditTextView.createTokenizedEntry (cognitive 24) · ×1
  • RecipientEditTextView.createTokenizedEntry (cognitive 24) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:1026 — RecipientEditTextView.createTokenizedEntry has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 3, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecipientEditTextView.shrink (cognitive 24) · ×1
  • RecipientEditTextView.shrink (cognitive 24) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:472 — RecipientEditTextView.shrink has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlarmStateManager.registerInstance (cognitive 24) · ×1
  • AlarmStateManager.registerInstance (cognitive 24) apps/DeskClock/src/com/android/deskclock/alarms/AlarmStateManager.java:505 — AlarmStateManager.registerInstance has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EditEventFragment.startQuery (cognitive 23) · ×1
  • EditEventFragment.startQuery (cognitive 23) apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:461 — EditEventFragment.startQuery has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (23 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CalendarAppWidgetModel.buildFromCursor (cognitive 23) · ×1
  • CalendarAppWidgetModel.buildFromCursor (cognitive 23) apps/Calendar/src/com/android/calendar/widget/CalendarAppWidgetModel.java:263 — CalendarAppWidgetModel.buildFromCursor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DayView.remeasure (cognitive 23) · ×1
  • DayView.remeasure (cognitive 23) apps/Calendar/src/com/android/calendar/DayView.java:1241 — DayView.remeasure has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecurrenceProcessor.filterMonthlySetPos (cognitive 23) · ×1
  • RecurrenceProcessor.filterMonthlySetPos (cognitive 23) apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:321 — RecurrenceProcessor.filterMonthlySetPos has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecipientEditTextView.commitChip (cognitive 23) · ×1
  • RecipientEditTextView.commitChip (cognitive 23) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:1205 — RecipientEditTextView.commitChip has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DigitalAppWidgetProvider.onReceive (cognitive 23) · ×1
  • DigitalAppWidgetProvider.onReceive (cognitive 23) apps/DeskClock/src/com/android/alarmclock/DigitalAppWidgetProvider.java:75 — DigitalAppWidgetProvider.onReceive has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Tweener.to (cognitive 23) · ×1
  • Tweener.to (cognitive 23) apps/DeskClock/src/com/android/deskclock/widget/multiwaveview/Tweener.java:57 — Tweener.to has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 2, loops 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.
D2 · Cognitive Complexity · StaggeredGridView.computeScroll (cognitive 23) · ×1
  • StaggeredGridView.computeScroll (cognitive 23) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:1349 — StaggeredGridView.computeScroll has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaggeredGridView.trackMotionScroll (cognitive 23) · ×1
  • StaggeredGridView.trackMotionScroll (cognitive 23) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:1129 — StaggeredGridView.trackMotionScroll has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 2 (6 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MonthWeekEventsView.drawDNA (cognitive 22) · ×1
  • MonthWeekEventsView.drawDNA (cognitive 22) apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:969 — MonthWeekEventsView.drawDNA has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataUsageStatUpdater.update (cognitive 22) · ×1
  • DataUsageStatUpdater.update (cognitive 22) apps/Calendar/src/com/android/common/contacts/DataUsageStatUpdater.java:200 — DataUsageStatUpdater.update has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecipientEditTextView.selectChip (cognitive 22) · ×1
  • RecipientEditTextView.selectChip (cognitive 22) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:1977 — RecipientEditTextView.selectChip has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StopwatchService.onStartCommand (cognitive 22) · ×1
  • StopwatchService.onStartCommand (cognitive 22) apps/DeskClock/src/com/android/deskclock/stopwatch/StopwatchService.java:52 — StopwatchService.onStartCommand has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (21 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.
D2 · Cognitive Complexity · TimerReceiver.showInUseNotification (cognitive 22) · ×1
  • TimerReceiver.showInUseNotification (cognitive 22) apps/DeskClock/src/com/android/deskclock/timer/TimerReceiver.java:237 — TimerReceiver.showInUseNotification has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TouchInterceptor.doExpansion (cognitive 22) · ×1
  • TouchInterceptor.doExpansion (cognitive 22) apps/Music/src/com/android/music/TouchInterceptor.java:249 — TouchInterceptor.doExpansion has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlertReceiver.onReceive (cognitive 21) · ×1
  • AlertReceiver.onReceive (cognitive 21) apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:101 — AlertReceiver.onReceive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (21 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.
D2 · Cognitive Complexity · AlertService.generateAlerts (cognitive 21) · ×1
  • AlertService.generateAlerts (cognitive 21) apps/Calendar/src/com/android/calendar/alerts/AlertService.java:307 — AlertService.generateAlerts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 2, boolean chains 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.
D2 · Cognitive Complexity · EditEventHelper.offsetStartTimeIfNecessary (cognitive 21) · ×1
  • EditEventHelper.offsetStartTimeIfNecessary (cognitive 21) apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:1306 — EditEventHelper.offsetStartTimeIfNecessary has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleDayPickerFragment.goTo (cognitive 21) · ×1
  • SimpleDayPickerFragment.goTo (cognitive 21) apps/Calendar/src/com/android/calendar/month/SimpleDayPickerFragment.java:378 — SimpleDayPickerFragment.goTo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 1, loops 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.
D2 · Cognitive Complexity · SelectCalendarsSimpleAdapter.getView (cognitive 21) · ×1
  • SelectCalendarsSimpleAdapter.getView (cognitive 21) apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java:217 — SelectCalendarsSimpleAdapter.getView has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DayView.adjustHourSelection (cognitive 21) · ×1
  • DayView.adjustHourSelection (cognitive 21) apps/Calendar/src/com/android/calendar/DayView.java:1933 — DayView.adjustHourSelection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecipientEditTextView.handlePaste (cognitive 21) · ×1
  • RecipientEditTextView.handlePaste (cognitive 21) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:2395 — RecipientEditTextView.handlePaste has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CircleTimerView.onDraw (cognitive 21) · ×1
  • CircleTimerView.onDraw (cognitive 21) apps/DeskClock/src/com/android/deskclock/CircleTimerView.java:137 — CircleTimerView.onDraw has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QueryListAdapter.bindView (cognitive 21) · ×1
  • QueryListAdapter.bindView (cognitive 21) apps/Music/src/com/android/music/QueryBrowserActivity.java:377 — QueryListAdapter.bindView has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · MonthWeekEventsView.drawEvent (cognitive 20) · ×1
  • MonthWeekEventsView.drawEvent (cognitive 20) apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:822 — MonthWeekEventsView.drawEvent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (17 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MonthWeekEventsView.drawEvents (cognitive 20) · ×1
  • MonthWeekEventsView.drawEvents (cognitive 20) apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:720 — MonthWeekEventsView.drawEvents has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AllInOneActivity.onOptionsItemSelected (cognitive 20) · ×1
  • AllInOneActivity.onOptionsItemSelected (cognitive 20) apps/Calendar/src/com/android/calendar/AllInOneActivity.java:756 — AllInOneActivity.onOptionsItemSelected has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3 (6 pts), boolean chains 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.
D2 · Cognitive Complexity · CalendarEventModel.<init> (cognitive 20) · ×1
  • CalendarEventModel.<init> (cognitive 20) apps/Calendar/src/com/android/calendar/CalendarEventModel.java:305 — CalendarEventModel.<init> has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DayView.computeAllDayNeighbors (cognitive 20) · ×1
  • DayView.computeAllDayNeighbors (cognitive 20) apps/Calendar/src/com/android/calendar/DayView.java:3034 — DayView.computeAllDayNeighbors has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (4 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.
D2 · Cognitive Complexity · DayView.onCreateContextMenu (cognitive 20) · ×1
  • DayView.onCreateContextMenu (cognitive 20) apps/Calendar/src/com/android/calendar/DayView.java:4337 — DayView.onCreateContextMenu has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (20 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DayView.setSelected (cognitive 20) · ×1
  • DayView.setSelected (cognitive 20) apps/Calendar/src/com/android/calendar/DayView.java:1007 — DayView.setSelected has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecurrenceProcessor.unsafeNormalize (cognitive 20) · ×1
  • RecurrenceProcessor.unsafeNormalize (cognitive 20) apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:1140 — RecurrenceProcessor.unsafeNormalize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 4 (5 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecipientEditTextView.createUnselectedChip (cognitive 20) · ×1
  • RecipientEditTextView.createUnselectedChip (cognitive 20) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:590 — RecipientEditTextView.createUnselectedChip has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, ternaries 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.
D2 · Cognitive Complexity · RecipientEditTextView.onTouchEvent (cognitive 20) · ×1
  • RecipientEditTextView.onTouchEvent (cognitive 20) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:1423 — RecipientEditTextView.onTouchEvent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimeZoneData.printTimeZones (cognitive 20) · ×1
  • TimeZoneData.printTimeZones (cognitive 20) apps/Calendar/src/com/android/timezonepicker/TimeZoneData.java:232 — TimeZoneData.printTimeZones has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaggeredGridView.populate (cognitive 20) · ×1
  • StaggeredGridView.populate (cognitive 20) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:1576 — StaggeredGridView.populate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · 5.onChanged (cognitive 20) · ×1
  • 5.onChanged (cognitive 20) apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:296 — 5.onChanged has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 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.
D2 · Cognitive Complexity · MediaPlaybackService.onStartCommand (cognitive 20) · ×1
  • MediaPlaybackService.onStartCommand (cognitive 20) apps/Music/src/com/android/music/MediaPlaybackService.java:657 — MediaPlaybackService.onStartCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · MediaPlaybackService.removeTracksInternal (cognitive 20) · ×1
  • MediaPlaybackService.removeTracksInternal (cognitive 20) apps/Music/src/com/android/music/MediaPlaybackService.java:1611 — MediaPlaybackService.removeTracksInternal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MusicUtils.getArtworkQuick (cognitive 20) · ×1
  • MusicUtils.getArtworkQuick (cognitive 20) apps/Music/src/com/android/music/MusicUtils.java:927 — MusicUtils.getArtworkQuick has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AlertReceiver.createEmailIntent (cognitive 19) · ×1
  • AlertReceiver.createEmailIntent (cognitive 19) apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:673 — AlertReceiver.createEmailIntent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, boolean chains 5, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AlertService.processMessage (cognitive 19) · ×1
  • AlertService.processMessage (cognitive 19) apps/Calendar/src/com/android/calendar/alerts/AlertService.java:173 — AlertService.processMessage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · GlobalDismissManager.syncSenderDismissCache (cognitive 19) · ×1
  • GlobalDismissManager.syncSenderDismissCache (cognitive 19) apps/Calendar/src/com/android/calendar/alerts/GlobalDismissManager.java:277 — GlobalDismissManager.syncSenderDismissCache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 1 (5 pts), loops 2 (4 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.
D2 · Cognitive Complexity · EventLocationAdapter.getView (cognitive 19) · ×1
  • EventLocationAdapter.getView (cognitive 19) apps/Calendar/src/com/android/calendar/event/EventLocationAdapter.java:171 — EventLocationAdapter.getView has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimeZoneUtils.setTimeZone (cognitive 19) · ×1
  • TimeZoneUtils.setTimeZone (cognitive 19) apps/Calendar/src/com/android/calendar/CalendarUtils.java:199 — TimeZoneUtils.setTimeZone has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimeZoneResultAdapter.saveRecentTimezone (cognitive 19) · ×1
  • TimeZoneResultAdapter.saveRecentTimezone (cognitive 19) apps/Calendar/src/com/android/timezonepicker/TimeZoneResultAdapter.java:198 — TimeZoneResultAdapter.saveRecentTimezone has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 2.onPreDraw (cognitive 19) · ×1
  • 2.onPreDraw (cognitive 19) apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:866 — 2.onPreDraw has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrackBrowserActivity.init (cognitive 19) · ×1
  • TrackBrowserActivity.init (cognitive 19) apps/Music/src/com/android/music/TrackBrowserActivity.java:361 — TrackBrowserActivity.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VerticalTextSpinner.onTouchEvent (cognitive 19) · ×1
  • VerticalTextSpinner.onTouchEvent (cognitive 19) apps/Music/src/com/android/music/VerticalTextSpinner.java:211 — VerticalTextSpinner.onTouchEvent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · EditEventHelper.getContentValuesFromModel (cognitive 18) · ×1
  • EditEventHelper.getContentValuesFromModel (cognitive 18) apps/Calendar/src/com/android/calendar/event/EditEventHelper.java:1214 — EditEventHelper.getContentValuesFromModel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), ternaries 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.
D2 · Cognitive Complexity · CalendarViewAdapter.getView (cognitive 18) · ×1
  • CalendarViewAdapter.getView (cognitive 18) apps/Calendar/src/com/android/calendar/CalendarViewAdapter.java:164 — CalendarViewAdapter.getView has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (4 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.
D2 · Cognitive Complexity · DayView.drawDayHeaderLoop (cognitive 18) · ×1
  • DayView.drawDayHeaderLoop (cognitive 18) apps/Calendar/src/com/android/calendar/DayView.java:2354 — DayView.drawDayHeaderLoop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DayView.onDraw (cognitive 18) · ×1
  • DayView.onDraw (cognitive 18) apps/Calendar/src/com/android/calendar/DayView.java:2169 — DayView.onDraw has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 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.
D2 · Cognitive Complexity · ICalendar.parseLine (cognitive 18) · ×1
  • ICalendar.parseLine (cognitive 18) apps/Calendar/src/com/android/calendarcommon2/ICalendar.java:468 — ICalendar.parseLine has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompositeCursorAdapter.getView (cognitive 18) · ×1
  • CompositeCursorAdapter.getView (cognitive 18) apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:326 — CompositeCursorAdapter.getView has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseRecipientAdapter.getView (cognitive 18) · ×1
  • BaseRecipientAdapter.getView (cognitive 18) apps/Calendar/src/com/android/ex/chips/BaseRecipientAdapter.java:947 — BaseRecipientAdapter.getView has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1, ternaries 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.
D2 · Cognitive Complexity · StaggeredGridView.computeVerticalScrollOffset (cognitive 18) · ×1
  • StaggeredGridView.computeVerticalScrollOffset (cognitive 18) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:3462 — StaggeredGridView.computeVerticalScrollOffset has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArtistAlbumBrowserActivity.onContextItemSelected (cognitive 18) · ×1
  • ArtistAlbumBrowserActivity.onContextItemSelected (cognitive 18) apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:384 — ArtistAlbumBrowserActivity.onContextItemSelected has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (6 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ArtistAlbumBrowserActivity.onCreateContextMenu (cognitive 18) · ×1
  • ArtistAlbumBrowserActivity.onCreateContextMenu (cognitive 18) apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:321 — ArtistAlbumBrowserActivity.onCreateContextMenu has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · MusicUtils.displayDatabaseError (cognitive 18) · ×1
  • MusicUtils.displayDatabaseError (cognitive 18) apps/Music/src/com/android/music/MusicUtils.java:650 — MusicUtils.displayDatabaseError has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgendaWindowAdapter.doQuery (cognitive 17) · ×1
  • AgendaWindowAdapter.doQuery (cognitive 17) apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java:883 — AgendaWindowAdapter.doQuery has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GlobalDismissManager.processEventIds (cognitive 17) · ×1
  • GlobalDismissManager.processEventIds (cognitive 17) apps/Calendar/src/com/android/calendar/alerts/GlobalDismissManager.java:210 — GlobalDismissManager.processEventIds has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EditEventFragment.onActionBarItemSelected (cognitive 17) · ×1
  • EditEventFragment.onActionBarItemSelected (cognitive 17) apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:655 — EditEventFragment.onActionBarItemSelected has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 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.
D2 · Cognitive Complexity · EditEventFragment.onCreate (cognitive 17) · ×1
  • EditEventFragment.onCreate (cognitive 17) apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:597 — EditEventFragment.onCreate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (17 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.
D2 · Cognitive Complexity · EditEventView.addFieldsRecursive (cognitive 17) · ×1
  • EditEventView.addFieldsRecursive (cognitive 17) apps/Calendar/src/com/android/calendar/event/EditEventView.java:1266 — EditEventView.addFieldsRecursive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EditEventView.setCalendarsCursor (cognitive 17) · ×1
  • EditEventView.setCalendarsCursor (cognitive 17) apps/Calendar/src/com/android/calendar/event/EditEventView.java:1330 — EditEventView.setCalendarsCursor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeleteEventHelper.delete (cognitive 17) · ×1
  • DeleteEventHelper.delete (cognitive 17) apps/Calendar/src/com/android/calendar/DeleteEventHelper.java:257 — DeleteEventHelper.delete has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Event.doComputePositions (cognitive 17) · ×1
  • Event.doComputePositions (cognitive 17) apps/Calendar/src/com/android/calendar/Event.java:446 — Event.doComputePositions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Duration.parse (cognitive 17) · ×1
  • Duration.parse (cognitive 17) apps/Calendar/src/com/android/calendarcommon2/Duration.java:49 — Duration.parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 1, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CompositeCursorAdapter.getItemId (cognitive 17) · ×1
  • CompositeCursorAdapter.getItemId (cognitive 17) apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:441 — CompositeCursorAdapter.getItemId has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseRecipientAdapter.setupOtherDirectories (cognitive 17) · ×1
  • BaseRecipientAdapter.setupOtherDirectories (cognitive 17) apps/Calendar/src/com/android/ex/chips/BaseRecipientAdapter.java:600 — BaseRecipientAdapter.setupOtherDirectories has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecipientEditTextView.createReplacementChip (cognitive 17) · ×1
  • RecipientEditTextView.createReplacementChip (cognitive 17) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:969 — RecipientEditTextView.createReplacementChip has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecipientEditTextView.sanitizeBetween (cognitive 17) · ×1
  • RecipientEditTextView.sanitizeBetween (cognitive 17) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:1247 — RecipientEditTextView.sanitizeBetween has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaggeredGridView.handleOverfling (cognitive 17) · ×1
  • StaggeredGridView.handleOverfling (cognitive 17) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:1399 — StaggeredGridView.handleOverfling has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 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.
D2 · Cognitive Complexity · StaggeredGridView.restoreScrollPosition (cognitive 17) · ×1
  • StaggeredGridView.restoreScrollPosition (cognitive 17) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:3259 — StaggeredGridView.restoreScrollPosition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 1.onReceive (cognitive 17) · ×1
  • 1.onReceive (cognitive 17) apps/DeskClock/src/com/android/deskclock/ClockFragment.java:63 — 1.onReceive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2 (nesting depth added 8). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MusicPicker.onCreate (cognitive 17) · ×1
  • MusicPicker.onCreate (cognitive 17) apps/Music/src/com/android/music/MusicPicker.java:406 — MusicPicker.onCreate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 3.onServiceConnected (cognitive 17) · ×1
  • 3.onServiceConnected (cognitive 17) apps/Music/src/com/android/music/PlaylistBrowserActivity.java:99 — 3.onServiceConnected has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 1 (3 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.
D2 · Cognitive Complexity · TrackListAdapter.bindView (cognitive 17) · ×1
  • TrackListAdapter.bindView (cognitive 17) apps/Music/src/com/android/music/TrackBrowserActivity.java:1468 — TrackListAdapter.bindView has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, error handling 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.
D2 · Cognitive Complexity · EditEventActivity.getEventInfoFromIntent (cognitive 16) · ×1
  • EditEventActivity.getEventInfoFromIntent (cognitive 16) apps/Calendar/src/com/android/calendar/event/EditEventActivity.java:119 — EditEventActivity.getEventInfoFromIntent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 1 (2 pts), boolean chains 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.
D2 · Cognitive Complexity · EditEventFragment.displayEditWhichDialog (cognitive 16) · ×1
  • EditEventFragment.displayEditWhichDialog (cognitive 16) apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:708 — EditEventFragment.displayEditWhichDialog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecurrencePickerDialog.canHandleRecurrenceRule (cognitive 16) · ×1
  • RecurrencePickerDialog.canHandleRecurrenceRule (cognitive 16) apps/Calendar/src/com/android/calendar/recurrencepicker/RecurrencePickerDialog.java:360 — RecurrencePickerDialog.canHandleRecurrenceRule has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 1, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AsyncTZHandler.onQueryComplete (cognitive 16) · ×1
  • AsyncTZHandler.onQueryComplete (cognitive 16) apps/Calendar/src/com/android/calendar/CalendarUtils.java:94 — AsyncTZHandler.onQueryComplete has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EventGeometry.pointToEvent (cognitive 16) · ×1
  • EventGeometry.pointToEvent (cognitive 16) apps/Calendar/src/com/android/calendar/EventGeometry.java:120 — EventGeometry.pointToEvent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 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.
D2 · Cognitive Complexity · EventInfoFragment.initReminders (cognitive 16) · ×1
  • EventInfoFragment.initReminders (cognitive 16) apps/Calendar/src/com/android/calendar/EventInfoFragment.java:1909 — EventInfoFragment.initReminders has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (5 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.
D2 · Cognitive Complexity · Utils.getDisplayedDatetime (cognitive 16) · ×1
  • Utils.getDisplayedDatetime (cognitive 16) apps/Calendar/src/com/android/calendar/Utils.java:1404 — Utils.getDisplayedDatetime has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecurrenceProcessor.expand (cognitive 16) · ×1
  • RecurrenceProcessor.expand (cognitive 16) apps/Calendar/src/com/android/calendarcommon2/RecurrenceProcessor.java:638 — RecurrenceProcessor.expand has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 7 (nesting depth added 4). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · BaseEmailAddressAdapter.isDuplicate (cognitive 16) · ×1
  • BaseEmailAddressAdapter.isDuplicate (cognitive 16) apps/Calendar/src/com/android/common/contacts/BaseEmailAddressAdapter.java:571 — BaseEmailAddressAdapter.isDuplicate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DefaultFilter.performFiltering (cognitive 16) · ×1
  • DefaultFilter.performFiltering (cognitive 16) apps/Calendar/src/com/android/ex/chips/BaseRecipientAdapter.java:224 — DefaultFilter.performFiltering has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecipientAlternatesAdapter.getBetterRecipient (cognitive 16) · ×1
  • RecipientAlternatesAdapter.getBetterRecipient (cognitive 16) apps/Calendar/src/com/android/ex/chips/RecipientAlternatesAdapter.java:263 — RecipientAlternatesAdapter.getBetterRecipient has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · RecipientEditTextView.createMoreChip (cognitive 16) · ×1
  • RecipientEditTextView.createMoreChip (cognitive 16) apps/Calendar/src/com/android/ex/chips/RecipientEditTextView.java:1864 — RecipientEditTextView.createMoreChip has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaggeredGridView.obtainView (cognitive 16) · ×1
  • StaggeredGridView.obtainView (cognitive 16) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:3075 — StaggeredGridView.obtainView has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 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.
D2 · Cognitive Complexity · AudioPreview.onCreate (cognitive 16) · ×1
  • AudioPreview.onCreate (cognitive 16) apps/Music/src/com/android/music/AudioPreview.java:74 — AudioPreview.onCreate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · MediaPickerActivity.MakeCursor (cognitive 16) · ×1
  • MediaPickerActivity.MakeCursor (cognitive 16) apps/Music/src/com/android/music/MediaPickerActivity.java:136 — MediaPickerActivity.MakeCursor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaPlaybackService.moveQueueItem (cognitive 16) · ×1
  • MediaPlaybackService.moveQueueItem (cognitive 16) apps/Music/src/com/android/music/MediaPlaybackService.java:976 — MediaPlaybackService.moveQueueItem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MusicUtils.deleteTracks (cognitive 16) · ×1
  • MusicUtils.deleteTracks (cognitive 16) apps/Music/src/com/android/music/MusicUtils.java:456 — MusicUtils.deleteTracks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), error handling 2 (5 pts), loops 3 (5 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.
D4 · Code Duplication · Near-duplicate member family (4 members, 18 shared lines) · ×1
  • Near-duplicate member family (4 members, 18 shared lines) apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:353 — apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:353-389 | apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:291-335 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:351-387 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:289-333 — These 4 members are variants of one another: a block of 18 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 pair (65 shared lines) · ×1
  • Near-duplicate member pair (65 shared lines) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2513 — apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2513-2656 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2665-2801 — These two members are variants of one another: 65 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 · Edited copy of a member (45 corresponding lines) · ×1
  • Edited copy of a member (45 corresponding lines) apps/Calendar/src/com/android/calendarcommon2/RecurrenceSet.java:259 — apps/Calendar/src/com/android/calendarcommon2/RecurrenceSet.java:259-325 | apps/Calendar/src/com/android/calendarcommon2/RecurrenceSet.java:328-384 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:60 — apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:60-79 | apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:97-144 | apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:85-146 | apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java:58-77 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:95-142 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:83-144 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (102 corresponding lines) · ×1
  • Edited copy of a member (102 corresponding lines) apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1379 — apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1379-1505 | apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1511-1612 — These two members are one piece of code written twice and then edited apart: 102 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (70 corresponding lines) · ×1
  • Edited copy of a member (70 corresponding lines) apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1428 — apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1428-1503 | apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1541-1610 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2830 — apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2830-2889 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2912-2975 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) apps/Music/src/com/android/music/AlbumBrowserActivity.java:90 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:90-139 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:86-138 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) apps/Music/src/com/android/music/CreatePlaylist.java:45 — apps/Music/src/com/android/music/CreatePlaylist.java:45-76 | apps/Music/src/com/android/music/RenamePlaylist.java:46-90 — 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 (35 corresponding lines) · ×1
  • Edited copy of a member (35 corresponding lines) apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java:174 — apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java:174-209 | apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSyncAdapter.java:105-139 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) apps/Music/src/com/android/music/MediaPlaybackService.java:278 — apps/Music/src/com/android/music/MediaPlaybackService.java:278-308 | apps/Music/src/com/android/music/MediaPlaybackService.java:657-700 — 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 (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) apps/DeskClock/src/com/android/deskclock/AlarmUtils.java:83 — apps/DeskClock/src/com/android/deskclock/AlarmUtils.java:83-112 | apps/DeskClock/src/com/android/deskclock/timer/TimerReceiver.java:344-373 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1690 — apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1690-1729 | apps/DeskClock/src/com/android/deskclock/AlarmClockFragment.java:1731-1778 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×1
  • Edited copy of a member (17 corresponding lines) apps/Calendar/src/com/android/calendar/AllInOneActivity.java:1249 — apps/Calendar/src/com/android/calendar/AllInOneActivity.java:1249-1265 | apps/Calendar/src/com/android/calendar/AllInOneActivity.java:1277-1307 — 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 (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) apps/Music/src/com/android/music/MusicUtils.java:94 — apps/Music/src/com/android/music/MusicUtils.java:94-119 | apps/Music/src/com/android/music/MusicUtils.java:124-151 — 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 (47 corresponding lines) · ×1
  • Edited copy of a member (47 corresponding lines) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:331 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:331-377 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:329-375 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 12+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 12+ corresponding lines) apps/Music/src/com/android/music/AlbumBrowserActivity.java:576 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:576-587 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:635-649 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:653-664 | apps/Music/src/com/android/music/TrackBrowserActivity.java:1451-1465 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 16+ corresponding lines) apps/Music/src/com/android/music/CreatePlaylist.java:101 — apps/Music/src/com/android/music/CreatePlaylist.java:101-116 | apps/Music/src/com/android/music/RenamePlaylist.java:121-136 | apps/Music/src/com/android/music/RenamePlaylist.java:138-153 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 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, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) apps/DeskClock/src/com/android/deskclock/widget/sgv/SgvAnimationHelper.java:203 — apps/DeskClock/src/com/android/deskclock/widget/sgv/SgvAnimationHelper.java:203-221 | apps/DeskClock/src/com/android/deskclock/widget/sgv/SgvAnimationHelper.java:227-244 | apps/DeskClock/src/com/android/deskclock/widget/sgv/SgvAnimationHelper.java:303-324 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 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) apps/Calendar/src/com/android/common/content/SQLiteContentProvider.java:97 — apps/Calendar/src/com/android/common/content/SQLiteContentProvider.java:97-121 | apps/Calendar/src/com/android/common/content/SQLiteContentProvider.java:150-175 | apps/Calendar/src/com/android/common/content/SQLiteContentProvider.java:178-202 — 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 copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) apps/Music/src/com/android/music/AlbumBrowserActivity.java:230 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:230-253 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:233-257 | apps/Music/src/com/android/music/PlaylistBrowserActivity.java:240-262 — These 3 members are one piece of code written 3 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 3 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) apps/DeskClock/src/com/android/deskclock/provider/Alarm.java:167 — apps/DeskClock/src/com/android/deskclock/provider/Alarm.java:167-186 | apps/DeskClock/src/com/android/deskclock/provider/AlarmInstance.java:187-206 | apps/DeskClock/src/com/android/deskclock/provider/City.java:112-131 — 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 copies of one member (5 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 12+ corresponding lines) apps/Music/src/com/android/music/AlbumBrowserActivity.java:644 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:644-655 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:834-845 | apps/Music/src/com/android/music/PlaylistBrowserActivity.java:629-640 | apps/Music/src/com/android/music/QueryBrowserActivity.java:468-479 | apps/Music/src/com/android/music/TrackBrowserActivity.java:1546-1557 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) apps/DeskClock/src/com/android/deskclock/provider/Alarm.java:136 — apps/DeskClock/src/com/android/deskclock/provider/Alarm.java:136-152 | apps/DeskClock/src/com/android/deskclock/provider/AlarmInstance.java:144-160 | apps/DeskClock/src/com/android/deskclock/provider/City.java:80-97 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 14+ corresponding lines) apps/Calendar/src/com/android/calendar/AsyncQueryService.java:170 — apps/Calendar/src/com/android/calendar/AsyncQueryService.java:170-185 | apps/Calendar/src/com/android/calendar/AsyncQueryService.java:202-215 | apps/Calendar/src/com/android/calendar/AsyncQueryService.java:238-253 | apps/Calendar/src/com/android/calendar/AsyncQueryService.java:275-289 | apps/Calendar/src/com/android/calendar/AsyncQueryService.java:306-319 — These 5 members are one piece of code written 5 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 5 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) apps/DeskClock/src/com/android/deskclock/alarms/AlarmStateManager.java:260 — apps/DeskClock/src/com/android/deskclock/alarms/AlarmStateManager.java:260-272 | apps/DeskClock/src/com/android/deskclock/alarms/AlarmStateManager.java:282-294 | apps/DeskClock/src/com/android/deskclock/alarms/AlarmStateManager.java:304-316 | apps/DeskClock/src/com/android/deskclock/alarms/AlarmStateManager.java:326-338 — 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 copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) apps/Calendar/src/com/android/calendar/selectcalendars/CalendarColorSquare.java:42 — apps/Calendar/src/com/android/calendar/selectcalendars/CalendarColorSquare.java:42-46 | apps/Calendar/src/com/android/colorpicker/ColorPickerSwatch.java:65-69 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1762 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1762-1764 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1762-1764 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (161 lines × 2) · ×1
  • Duplicated block (161 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:567 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:567-727 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:565-725 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (125 lines × 2) · ×1
  • Duplicated block (125 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:813 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:813-937 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:811-935 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (149 lines × 2) · ×1
  • Duplicated block (149 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:195 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:195-343 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:193-341 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (106 lines × 2) · ×1
  • Duplicated block (106 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1494 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1494-1599 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1494-1599 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (186 lines × 2) · ×1
  • Duplicated block (186 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:914 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:914-1099 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:914-1099 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (87 lines × 2) · ×1
  • Duplicated block (87 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1365 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1365-1451 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1365-1451 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (84 lines × 2) · ×1
  • Duplicated block (84 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1118 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1118-1201 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1118-1201 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (135 lines × 2) · ×1
  • Duplicated block (135 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1783 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1783-1917 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1783-1917 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (121–123 lines × 2) · ×1
  • Duplicated block (121–123 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1921 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1921-2041 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1921-2043 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (73 lines × 2) · ×1
  • Duplicated block (73 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:199 — apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:199-271 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:197-269 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (76 lines × 2) · ×1
  • Duplicated block (76 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:198 — apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java:198-273 | apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java:196-271 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DatePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DatePickerDialog.java` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (64 lines × 2) · ×1
  • Duplicated block (64 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2507 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2507-2570 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2509-2572 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (62 lines × 2) · ×1
  • Duplicated block (62 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1668 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1668-1729 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1668-1729 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (61 lines × 2) · ×1
  • Duplicated block (61 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:86 — apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:86-146 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:84-144 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (59 lines × 2) · ×1
  • Duplicated block (59 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/AmPmCirclesView.java:154 — apps/Calendar/src/com/android/datetimepicker/time/AmPmCirclesView.java:154-212 | apps/DeskClock/src/com/android/datetimepicker/time/AmPmCirclesView.java:152-210 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/AmPmCirclesView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/AmPmCirclesView.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (55 lines × 2) · ×1
  • Duplicated block (55 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:183 — apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:183-237 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:181-235 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:177 — apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:177-230 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:175-228 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (50 lines × 2) · ×1
  • Duplicated block (50 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:784 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:784-833 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:782-831 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (47 lines × 2) · ×1
  • Duplicated block (47 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:98 — apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:98-144 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:96-142 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (45–46 lines × 2) · ×1
  • Duplicated block (45–46 lines × 2) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2545 — apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2545-2589 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2696-2741 — 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 `apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2545` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (44 lines × 2) · ×1
  • Duplicated block (44 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:404 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:404-447 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:404-447 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (65 lines × 2) · ×1
  • Duplicated block (65 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:492 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:492-556 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:490-554 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:187 — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:187-223 | apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java:184-220 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 276 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:737 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:737-771 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:735-769 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:452 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:452-484 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:450-482 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:347 — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:347-377 | apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java:345-375 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java` and `apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 530 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (27–29 lines × 2) · ×1
  • Duplicated block (27–29 lines × 2) apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:337 — apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:337-365 | apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:403-429 — 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 `apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:337` 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, `apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:370` calls `add`, `RowInfo` and `apps/Calendar/src/com/android/calendar/agenda/AgendaByDayAdapter.java:430` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) apps/Calendar/src/com/android/calendar/DayView.java:3319 — apps/Calendar/src/com/android/calendar/DayView.java:3319-3344 | apps/Calendar/src/com/android/calendar/DayView.java:3350-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 `apps/Calendar/src/com/android/calendar/DayView.java:3319` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–22 lines × 3) · ×1
  • Duplicated block (21–22 lines × 3) apps/Music/src/com/android/music/AlbumBrowserActivity.java:160 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:160-180 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:161-182 | apps/Music/src/com/android/music/PlaylistBrowserActivity.java:188-208 — before extracting anything, compare `apps/Music/src/com/android/music/AlbumBrowserActivity.java` and `apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:183` calls `setListAdapter` and `apps/Music/src/com/android/music/AlbumBrowserActivity.java:181` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java:251 — apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java:251-271 | apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSyncAdapter.java:189-210 — before extracting anything, compare `apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java` and `apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSyncAdapter.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 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.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×1
  • Duplicated block (17–19 lines × 2) apps/Music/src/com/android/music/PlaylistBrowserActivity.java:419 — apps/Music/src/com/android/music/PlaylistBrowserActivity.java:419-435 | apps/Music/src/com/android/music/PlaylistBrowserActivity.java:442-460 — 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 `apps/Music/src/com/android/music/PlaylistBrowserActivity.java:419` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:366 — apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:366-383 | apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:313-330 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:364-381 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:311-328 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • Duplicated block (17 lines × 4) apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:95 — apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:95-111 | apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:275-291 | apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java:93-109 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:273-289 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/CircleView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 86 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 `apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) apps/Music/src/com/android/music/MediaPlaybackService.java:286 — apps/Music/src/com/android/music/MediaPlaybackService.java:286-301 | apps/Music/src/com/android/music/MediaPlaybackService.java:675-691 — 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 `apps/Music/src/com/android/music/MediaPlaybackService.java:286` 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.
D4 · Code Duplication · Duplicated block (11–16 lines × 2) · ×1
  • Duplicated block (11–16 lines × 2) apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:218 — apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:218-233 | apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:239-249 — 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 `apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:218` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:217` calls `setAction` and `apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java:238` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) apps/DeskClock/src/com/android/deskclock/widget/sgv/ReorderHelper.java:63 — apps/DeskClock/src/com/android/deskclock/widget/sgv/ReorderHelper.java:63-78 | apps/DeskClock/src/com/android/deskclock/widget/sgv/ReorderHelper.java:124-137 — 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 `apps/DeskClock/src/com/android/deskclock/widget/sgv/ReorderHelper.java:63` 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, `apps/DeskClock/src/com/android/deskclock/widget/sgv/ReorderHelper.java:140` calls `onEnterReorderArea` and `apps/DeskClock/src/com/android/deskclock/widget/sgv/ReorderHelper.java:79` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (4–15 lines × 4) · ×1
  • Duplicated block (4–15 lines × 4) apps/DeskClock/src/com/android/deskclock/alarms/AlarmNotifications.java:83 — apps/DeskClock/src/com/android/deskclock/alarms/AlarmNotifications.java:83-97 | apps/DeskClock/src/com/android/deskclock/alarms/AlarmNotifications.java:118-132 | apps/DeskClock/src/com/android/deskclock/alarms/AlarmNotifications.java:154-167 | apps/DeskClock/src/com/android/deskclock/alarms/AlarmStateManager.java:708-711 — 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 `apps/DeskClock/src/com/android/deskclock/alarms/AlarmNotifications.java:83` 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.
D4 · Code Duplication · Duplicated block (10–15 lines × 3) · ×1
  • Duplicated block (10–15 lines × 3) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2390 — apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2390-2399 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2610-2624 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2760-2769 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2625` calls `layout` and `apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2771` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14–15 lines × 3) · ×1
  • Duplicated block (14–15 lines × 3) apps/Music/src/com/android/music/AlbumBrowserActivity.java:433 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:433-446 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:302-315 | apps/Music/src/com/android/music/TrackBrowserActivity.java:943-957 — before extracting anything, compare `apps/Music/src/com/android/music/AlbumBrowserActivity.java` and `apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 147 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 `apps/Music/src/com/android/music/AlbumBrowserActivity.java:433` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:670 — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:670-699 | apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java:668-697 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java` and `apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 670 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java:229 — apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java:229-242 | apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSyncAdapter.java:158-171 | apps/Calendar/src/com/android/calendar/selectcalendars/SelectSyncedCalendarsMultiAccountAdapter.java:329-342 — before extracting anything, compare `apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java` and `apps/Calendar/src/com/android/calendar/selectcalendars/SelectCalendarsSyncAdapter.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:333 — apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:333-344 | apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:293-305 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:331-342 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:291-303 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2831 — apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2831-2841 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2913-2925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) apps/Music/src/com/android/music/AlbumBrowserActivity.java:310 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:310-321 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:402-414 — before extracting anything, compare `apps/Music/src/com/android/music/AlbumBrowserActivity.java` and `apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 147 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 `apps/Music/src/com/android/music/AlbumBrowserActivity.java:310` 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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) apps/Calendar/src/com/android/calendar/month/SimpleDayPickerFragment.java:412 — apps/Calendar/src/com/android/calendar/month/SimpleDayPickerFragment.java:412-423 | apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java:197-208 | apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java:195-206 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/date/DayPickerView.java` and `apps/DeskClock/src/com/android/datetimepicker/date/DayPickerView.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 270 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 `apps/Calendar/src/com/android/calendar/month/SimpleDayPickerFragment.java:412` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) apps/Calendar/src/com/android/common/contacts/BaseEmailAddressAdapter.java:392 — apps/Calendar/src/com/android/common/contacts/BaseEmailAddressAdapter.java:392-403 | apps/Calendar/src/com/android/ex/chips/BaseRecipientAdapter.java:624-634 — 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 `apps/Calendar/src/com/android/common/contacts/BaseEmailAddressAdapter.java:392` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–11 lines × 4) · ×1
  • Duplicated block (9–11 lines × 4) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1994 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1994-2003 | apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2297-2305 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1995-2005 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:2299-2307 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:3039 — apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:3039-3048 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:3097-3107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1523 — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1523-1532 | apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1688-1697 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1523-1532 | apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java:1688-1697 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java` as WHOLE FILES: this scan already matched 63 separate duplicated blocks between them, totalling at least 1949 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 `apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1523` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8–10 lines × 3) · ×1
  • Duplicated block (8–10 lines × 3) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2356 — apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2356-2365 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2579-2586 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2731-2738 — 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) apps/Music/src/com/android/music/TrackBrowserActivity.java:565 — apps/Music/src/com/android/music/TrackBrowserActivity.java:565-573 | apps/Music/src/com/android/music/TrackBrowserActivity.java:819-828 — 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 `apps/Music/src/com/android/music/TrackBrowserActivity.java:565` 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, `apps/Music/src/com/android/music/TrackBrowserActivity.java:564` calls `removeItem` and `apps/Music/src/com/android/music/TrackBrowserActivity.java:818` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:68 — apps/Calendar/src/com/android/datetimepicker/time/CircleView.java:68-76 | apps/Calendar/src/com/android/datetimepicker/time/RadialSelectorView.java:112-120 | apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:107-115 | apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java:66-74 | apps/DeskClock/src/com/android/datetimepicker/time/RadialSelectorView.java:110-118 | apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java:105-113 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/time/CircleView.java` and `apps/DeskClock/src/com/android/datetimepicker/time/CircleView.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 86 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: `R` names `com.android.calendar.R` in one and `com.android.deskclock.R` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2219 — apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2219-2227 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2514-2522 | apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java:2666-2674 — 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) apps/DeskClock/src/com/android/deskclock/timer/CountingTimerView.java:522 — apps/DeskClock/src/com/android/deskclock/timer/CountingTimerView.java:522-528 | apps/DeskClock/src/com/android/deskclock/timer/CountingTimerView.java:534-541 — 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 `apps/DeskClock/src/com/android/deskclock/timer/CountingTimerView.java:534` 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.
D4 · Code Duplication · Duplicated block (3–6 lines × 3) · ×1
  • Duplicated block (3–6 lines × 3) apps/Music/src/com/android/music/AlbumBrowserActivity.java:582 — apps/Music/src/com/android/music/AlbumBrowserActivity.java:582-587 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:643-645 | apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java:659-664 — before extracting anything, compare `apps/Music/src/com/android/music/AlbumBrowserActivity.java` and `apps/Music/src/com/android/music/ArtistAlbumBrowserActivity.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 147 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 `apps/Music/src/com/android/music/AlbumBrowserActivity.java:582` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:236 — apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:236-240 | apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:305-309 | apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:327-331 | apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:488-492 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `apps/Calendar/src/com/android/common/widget/CompositeCursorAdapter.java:236` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (319 lines × 2) · ×1
  • Duplicated block (319 lines × 2) apps/Calculator/src/com/android/calculator2/viewpager/PagerAdapter.java:1 — apps/Calculator/src/com/android/calculator2/viewpager/PagerAdapter.java:1-319 | apps/DeskClock/src/com/android/deskclock/viewpager/PagerAdapter.java:1-319 — before extracting anything, compare `apps/Calculator/src/com/android/calculator2/viewpager/PagerAdapter.java` and `apps/DeskClock/src/com/android/deskclock/viewpager/PagerAdapter.java` as WHOLE FILES: 99% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/Calculator/src/com/android/calculator2/viewpager/PagerAdapter.java:1` 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.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×1
  • Duplicated block (53 lines × 2) apps/Calendar/src/com/android/common/SharedPreferencesCompat.java:1 — apps/Calendar/src/com/android/common/SharedPreferencesCompat.java:1-53 | apps/Music/src/com/android/music/SharedPreferencesCompat.java:1-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 `apps/Calendar/src/com/android/common/SharedPreferencesCompat.java:1` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) apps/Calendar/src/com/android/datetimepicker/AccessibleLinearLayout.java:33 — apps/Calendar/src/com/android/datetimepicker/AccessibleLinearLayout.java:33-47 | apps/Calendar/src/com/android/datetimepicker/AccessibleTextView.java:33-47 | apps/DeskClock/src/com/android/datetimepicker/AccessibleLinearLayout.java:31-45 | apps/DeskClock/src/com/android/datetimepicker/AccessibleTextView.java:31-45 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/AccessibleLinearLayout.java` and `apps/Calendar/src/com/android/datetimepicker/AccessibleTextView.java` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (56 lines × 2) · ×1
  • Duplicated block (56 lines × 2) apps/Calendar/src/com/android/datetimepicker/HapticFeedbackController.java:20 — apps/Calendar/src/com/android/datetimepicker/HapticFeedbackController.java:20-75 | apps/DeskClock/src/com/android/datetimepicker/HapticFeedbackController.java:18-73 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/HapticFeedbackController.java` and `apps/DeskClock/src/com/android/datetimepicker/HapticFeedbackController.java` as WHOLE FILES: 98% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) apps/Calendar/src/com/android/calendar/Utils.java:597 — apps/Calendar/src/com/android/calendar/Utils.java:597-604 | apps/Calendar/src/com/android/datetimepicker/Utils.java:113-120 | apps/DeskClock/src/com/android/datetimepicker/Utils.java:111-118 — before extracting anything, compare `apps/Calendar/src/com/android/datetimepicker/Utils.java` and `apps/DeskClock/src/com/android/datetimepicker/Utils.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
GD1 · Unfinished & placeholder code · Unfinished stub · ×1
  • Unfinished stub — empty body under a TODO marker apps/Calendar/src/com/android/calendar/event/EditEventFragment.java:929 — `eventsChanged` is a shipped method whose body is empty except for a TODO/FIXME — scaffolding that was never completed. Implement it or remove it.
P1 · CI/CD gates · No CI pipeline · ×1
  • No CI pipeline — No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
Minor — 44 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate apps/Calendar/src/com/android/calendar/alerts/AlertAdapter.java:132 — `!allDay && tz != Time.getCurrentTimezone()` appears character-identically in 2 files — apps/Calendar/src/com/android/calendar/alerts/AlertAdapter.java, apps/Calendar/src/com/android/calendar/alerts/AlertUtils.java. 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 apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:670 — `!allowEmptyDisplay && mTypedTimes.isEmpty()` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java, apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java. 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 apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:513 — `!always && mCurItem == item && mItems.size() != 0` appears character-identically in 2 files — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java, apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java. 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 apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java:1061 — `!am.isEnabled() || !am.isTouchExplorationEnabled()` appears character-identically in 2 files — apps/Calendar/src/com/android/calendar/month/MonthWeekEventsView.java, apps/Calendar/src/com/android/calendar/month/SimpleWeekView.java. 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 apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:444 — `!forceToVisibleValue && (currentShowing == MINUTE_INDEX)` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java, apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java. 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 apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1566 — `!lp.isDecor && (ii = infoForChild(child)) != null` appears character-identically in 2 files — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java, apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java. 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 apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java:639 — `!mDoingMove && dX <= TOUCH_SLOP && dY <= TOUCH_SLOP` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/time/RadialPickerLayout.java, apps/DeskClock/src/com/android/datetimepicker/time/RadialPickerLayout.java. 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 apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:739 — `!mIs24HourMode && isTypedTimeFullyLegal()` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java, apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java. 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 apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:592 — `!mIs24HourMode && mTypedTimes.size() <= 3` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java, apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java. 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 apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:338 — `!mIsInitialized || !mDrawValuesReady || mDisappearAnimator == null` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java, apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java. 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 apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java:347 — `!mIsInitialized || !mDrawValuesReady || mReappearAnimator == null` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/time/RadialTextsView.java, apps/DeskClock/src/com/android/datetimepicker/time/RadialTextsView.java. 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 apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:614 — `!mManager.isEnabled() || !accessibilityManager.isTouchExplorationEnabled()` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java, apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java. 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 apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:147 — `!mManager.isEnabled() || !mManager.isTouchExplorationEnabled()` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java, apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java. 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 apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1603 — `!mScroller.isFinished() && mScroller.computeScrollOffset()` appears character-identically in 2 files — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java, apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java. 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 apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:326 — `!params.containsKey(VIEW_PARAMS_MONTH) && !params.containsKey(VIEW_PARAMS_YEAR)` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java, apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java. 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 apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java:542 — `(day.year != mYear) || (day.month != mMonth) || (day.day > mNumCells)` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/date/SimpleMonthView.java, apps/DeskClock/src/com/android/datetimepicker/date/SimpleMonthView.java. 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 apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:552 — `(localRect == null) || localRect.isEmpty()` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java, apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java. 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 apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2807 — `(mAdapter != null) && (mAdapter.getCount() > 1)` appears character-identically in 2 files — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java, apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java. 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 apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java:577 — `(mIs24HourMode && mTypedTimes.size() == 4) || (!mIs24HourMode && isTypedTimeFullyLegal())` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/time/TimePickerDialog.java, apps/DeskClock/src/com/android/datetimepicker/time/TimePickerDialog.java. 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 apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:450 — `(node.getText() == null) && (node.getContentDescription() == null)` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java, apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java. 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 apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:565 — `(view.getAlpha() <= 0) || (view.getVisibility() != View.VISIBLE)` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java, apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java. 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 apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java:186 — `(virtualViewId == INVALID_ID) || !mManager.isEnabled()` appears character-identically in 2 files — apps/Calendar/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java, apps/DeskClock/src/com/android/datetimepicker/accessibility/ExploreByTouchHelper.java. 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 apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:1763 — `(x < mGutterSize && dx > 0) || (x > getWidth() - mGutterSize && dx < 0)` appears character-identically in 2 files — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java, apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java. 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 apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java:2145 — `Math.abs(deltaX) > mFlingDistance && Math.abs(velocity) > mMinimumVelocity` appears character-identically in 2 files — apps/Calculator/src/com/android/calculator2/viewpager/ViewPager.java, apps/DeskClock/src/com/android/deskclock/viewpager/ViewPager.java. 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 apps/Calendar/src/com/android/common/contacts/BaseEmailAddressAdapter.java:336 — `TextUtils.isEmpty(displayName) || TextUtils.equals(displayName, emailAddress)` appears character-identically in 2 files — apps/Calendar/src/com/android/common/contacts/BaseEmailAddressAdapter.java, apps/Calendar/src/com/android/ex/chips/BaseRecipientAdapter.java. 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.
  • + 15 more in this group — see findings.md.
D21 · Naming Consistency · `getContentURIForPath` spells `URI` where 23 names in the project spell it `Uri` · ×1
  • `getContentURIForPath` spells `URI` where 23 names in the project spell it `Uri` apps/Music/src/com/android/music/MusicUtils.java:736 — 23 of 24 names in project repository spell the token `Uri` (23 of 24; unit: names in project repository containing `Uri`). Peers: ContactsAsyncHelper.retrieveContactPhotoAsync(photoUri) (apps/Calendar/src/com/android/calendar/ContactsAsyncHelper.java:190); GeneralPreferences.getRingtoneTitleFromUri (apps/Calendar/src/com/android/calendar/GeneralPreferences.java:343); com.android.calendar.GoogleCalendarUriIntentFilter (apps/Calendar/src/com/android/calendar/GoogleCalendarUriIntentFilter.java:42); AgendaWindowAdapter.buildQueryUri (apps/Calendar/src/com/android/calendar/agenda/AgendaWindowAdapter.java:820); EventLocationAdapter.asyncLoadPhotoAndUpdateView(contactPhotoUri) (apps/Calendar/src/com/android/calendar/event/EventLocationAdapter.java:227). Rename to `getContentUriForPath`. [rule N6]
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
X5 · Nullable reference types · Java packages are not null-marked everywhere · ×1
  • Java packages are not null-marked everywhere — 0/44 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-d36a1018027f4df3a9821951cc2acd60/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-d36a1018027f4df3a9821951cc2acd60/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .17artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (no readable dependency manifest)—none (no readable dependency manifest): 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 Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems) — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 1 file(s) — `apps/CandyExperience/src/org/candyos/experience/Configs.kt` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D36 · Supply-chain Provenance & Signingprovenance—provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesnone (no readable dependency manifest)—none (no readable dependency manifest): 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 Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems) — not scanned yet).0—

Run 01a1e7f6-006c-7732-b2e1-18a5ac7f7405 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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