Public report of steipete/CodexBar, published 14 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 14 November 2026, 08:40 UTC · Survey ID cd_2ccfd74699dd47938c4f9d23958080c9
steipete/CodexBar
Measured 14 November 2026, 08:39 UTC, at code version 8d72580
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
Down 5 since the last survey
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: 293,209 lines of product code in 11 projects, tests not counted · Estimated rebuild effort: about 4.7 person-years · Weakest lens: Code Health, 23
Findings by how serious they are
73 critical3005 serious118 minor
23 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 08:39 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 ▸
56of 56 dimensions measured by tools.
3177of 3196 findings point to an exact file and line, so you can open each one in the code. The other 19 concern the repository as a whole, such as missing documentation.
56dimensions across 7 lenses, read from 293,209 lines of product code in 11 projects.
steipete/CodexBar falls short of our standard for a preview release, held back most by its Code Health lens, the quality of the code itself. It scores 40 out of 100 and is rated Weak, and 29 of its 73 critical findings are security problems.
Code Health, at 23, is the weakest lens and counts most in the score. The best first step is replacing the 22 exposed passwords or keys and switching the old ones off, worth about 9 points. Removing the copied code would lift Code Health itself, worth about 5 points. Raising Code Health to 67 would lift the score to about 53.
Twenty-two passwords or keys in the code and three in the code's history are open to anyone who can read the repository. Three pipeline steps run downloads nobody checks, and one weakness in the code could be used by an attacker. Replacing each exposed password or key, checking each download against a checksum and fixing the weaknesses the scanner points to would close these risks. Giving each kind of identifier a type of its own would take care of the 40 identifiers passed around as plain numbers or text.
The product code is 293,209 lines, about €680,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Code Health rose from 23 to 67, the lowest score rated Strong, the score would rise from 40 to about 53.
Code composition: what the lines of code are
Product code 37%Tests 63%
New since the last survey: 1259 findings
These 1259 critical or serious findings weren't in the previous survey, on 26 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 1584 findings
These 1584 critical or serious findings were in the previous survey, on 26 October 2026, and are gone from this one. The first 100 are listed here.
€230,000 to €1,100,000, for 3,775 to 11,976 hours of work, about 4.7 person-years for 2 to 9 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 40. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 293,209 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 22 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.
Raises the score by about 9 points · Medium effort · REDACTED Scanning
2
Act on each finding's own remediation rather than one rule: the move depends on what recurs.
Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
Raises the score by about 5 points · Medium effort · Code Duplication
3
Resolve the 40 finding(s) in Cyclomatic Complexity.
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 €680,000 to build again, about 4.7 person-years of work. Its weakest lens is Code Health, at 23 (Critical). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
One cause behind 43 Domain Modelling findings · Common cause
43 findings in the Domain Modelling lens come from the same cause. The code models the business as objects, such as an order or a customer, and each object should guard its own rules: an order, for example, should refuse to be shipped before it has been paid. Here the objects don't do that. Some objects only hold data, while the rules that should keep that data valid sit elsewhere in the code. Identifiers, such as order numbers and customer numbers, are passed around as plain numbers or text, so nothing stops the code from using one kind where another belongs. Because all of these findings have the same cause, fixing it once, in the business objects themselves, deals with them together.
Based on: Rich vs anemic domain model (3 findings) · Strongly-typed ids (40 findings)
What to do: Give each business object the methods that enforce its rules, such as a method for shipping an order that first checks it has been paid, and let only those methods change its data. Give each kind of identifier a type of its own, so an order number can't be used where a customer number belongs.
If you do one thing first · First action
Resolve the 22 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 9 points for medium effort, because it clears the 22 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 9% on every change. The history of the code shows how much it changes: about 592,801 lines over the last 90 days, which is about 2,404,137 lines a year. At that pace, the extra work comes to an estimated 239.8 to 1439 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
20 modules, with 20 dependencies between them. One loop runs through 4 of the modules, marked above the diagonal.
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.
Scripts uses Scripts.ci_swift_test_by_suite, so a change to Scripts.ci_swift_test_by_suite can break Scripts, while a change to Scripts can't break Scripts.ci_swift_test_by_suite.
Position
Below the diagonal: Scripts uses a module listed above it, which is the healthy direction.
165 pairs of types, where a type in CodexBarCore uses a type in repository. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
438 pairs of types, where a type in CodexBarCore uses a type in CodexBar. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
1715 pairs of types, where a type in CodexBar uses a type in CodexBarCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
CodexBarClaudeWebProbe uses CodexBarCore, so a change to CodexBarCore can break CodexBarClaudeWebProbe, while a change to CodexBarClaudeWebProbe can't break CodexBarCore.
Position
Below the diagonal: CodexBarClaudeWebProbe uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in AdaptiveRefreshCore uses a type in CodexBarCore.
The types involved
AdaptiveRefreshCore.Reason → CodexBarCore.String
Direction
AdaptiveRefreshCore uses CodexBarCore, so a change to CodexBarCore can break AdaptiveRefreshCore, while a change to AdaptiveRefreshCore can't break CodexBarCore.
Position
Below the diagonal: AdaptiveRefreshCore uses a module listed above it, which is the healthy direction.
30 pairs of types, where a type in AdaptiveReplayKit uses a type in CodexBarCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
AdaptiveReplayKit uses CodexBarCore, so a change to CodexBarCore can break AdaptiveReplayKit, while a change to AdaptiveReplayKit can't break CodexBarCore.
Position
Below the diagonal: AdaptiveReplayKit uses a module listed above it, which is the healthy direction.
350 pairs of types, where a type in CodexBarCLI uses a type in CodexBarCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
149 pairs of types, where a type in CodexBarWidget uses a type in CodexBarCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
68 pairs of types, where a type in CodexBarWidget uses a type in CodexBar. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
AdaptiveReplayCLI uses CodexBarCore, so a change to CodexBarCore can break AdaptiveReplayCLI, while a change to AdaptiveReplayCLI can't break CodexBarCore.
Position
Below the diagonal: AdaptiveReplayCLI uses a module listed above it, which is the healthy direction.
AdaptiveReplayCLI uses AdaptiveReplayKit, so a change to AdaptiveReplayKit can break AdaptiveReplayCLI, while a change to AdaptiveReplayCLI can't break AdaptiveReplayKit.
Position
Below the diagonal: AdaptiveReplayCLI uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 23% · Weak · gated by D2, R1, R10, R2, R7 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A07:2025 — Authentication Failures
26
High / Critical
A05:2025 — Injection
8
High / Critical
A03:2025 — Software Supply Chain Failures
5
Medium
Roadmap
Top priorities: Resolve the 22 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED; Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract; Resolve the 40 finding(s) in Cyclomatic Complexity.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 22 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Resolve the 205 No assertions finding(s) in Test Quality — start with CLIEntryTests.swift (5), CodexWorkspacesConfigurationTests.swift (3), ProviderPluginDetailsParityTests.swift (2).
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 — 73
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 — 3005
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 — 118
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 23
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 56 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 56 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 3177 of 3196 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Swift half could not be measured — the Swift suite in . produced no coverage export. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 2,092 test(s) behind this row are the ones the code-model census could read, and this repository also carries at least 23 test source file(s) (.py, .mjs) that it cannot: it reads the test types the .swift frontend declared, so a suite in any other language is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
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 (.swift, .py, .mjs) and this repository declares a SwiftPM test suite (CodexBar), but it was not re-run: the analyzer environment could not run it. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
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. `Package.swift`, `Scripts/cost_jsonl_shape_survey.swift`, `Sources/AdaptiveRefreshCore/AdaptiveRefreshPolicyCore.swift`, `Sources/CodexBar/AgentSessionsStore.swift`, `Sources/CodexBar/ChartBarHoverSelection.swift`, … (+372 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
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.
AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in Sources/CodexBar/Providers/Codex/CodexAppServerDaemon.swift, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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: a native UI project (WidgetExtension/CodexBarWidgetExtension.xcodeproj/project.pbxproj). 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. 'SQLite3' is imported (Sources/CodexBarCore/CodexThreadCatalogReader.swift:3), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
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. 'SQLite3' is imported (Sources/CodexBarCore/CodexThreadCatalogReader.swift:3), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
DM2 Strongly-typed ids — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 483 further occurrence(s) are not listed individually; the score already reflects all 523.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Swift, c, cpp is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Swift, c, cpp is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
R10 Code Duplication — 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. 118 further occurrence(s) are not listed individually; the score already reflects all 158.
R2 Cyclomatic Complexity — 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. 148 further occurrence(s) are not listed individually; the score already reflects all 188.
R4 Test Coverage — 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. 84 further occurrence(s) are not listed individually; the score already reflects all 124.
R7 Dead Code — 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. 74 further occurrence(s) are not listed individually; the score already reflects all 114.
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.
X1 Async correctness — 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.
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. 302 further occurrence(s) are not listed individually; the score already reflects all 342.
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.
X16 Unfloored truncation loop — 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.
X21 Side-effecting pattern guard — 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.
X27 Collection changed while being enumerated — 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.
X29 Per-element action decided by a fixed element — 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.
X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 56 further occurrence(s) are not listed individually; the score already reflects all 96.
X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP make no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
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.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
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.
386 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was fetchUsage at 135. A further 13 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being MenuBarLayoutToken.defaultEditorLabel at 36 — they are counted neither in the figure above nor in this dimension's score. 10 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: Sources/CodexBar/Menu/MenuBarLayoutEditor.swift (MenuBarLayoutToken.defaultEditorLabel at 36), Sources/CodexBar/Settings/PreferencesGeneralPane.swift (AppLanguage.labelKey at 25), Sources/CodexBar/Menu/MenuBarLayoutConditionalEditor.swift (MenuBarConditionalMetric.editorLabel at 23), Sources/CodexBar/StatusItem/StatusItemController+MenuActionMapping.swift (StatusItemController.selector at 21), Sources/CodexBar/StatusItem/StatusItemController+MenuWidthCache.swift (StatusItemController.measuredStandardMenuWidthCacheToken at 21), and 5 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 367 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with fetchUsage (cyclomatic 135). — Refactoring it lifts Cyclomatic Complexity from 5.7 to about 5.8/10.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 581 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 120 down to 120 or less in Cognitive Complexity — start with fetchUsage (cognitive 222), TTYCommandRunner.run (cognitive 141), ProviderPluginManifest.init (cognitive 125). — 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 3 together lifts Cognitive Complexity from 3.5 to about 4.6/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.
Do you agree with this assessment?
D3 · God Classes7.7 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 102 FileTooLong finding(s) in God Classes — start with ClaudeOAuthCredentials.swift, CostUsageFetcher.swift, SpendDashboardController.swift. — One of this dimension's main actionable groups (102 warning-level).
Resolve the 73 MethodTooLong finding(s) in God Classes — start with UsageStore+Refresh.swift (4), CostUsageFetcher.swift (3), SettingsStore.swift (2). — One of this dimension's main actionable groups (73 warning-level).
Resolve the 57 ClassTooLong finding(s) in God Classes — start with SpendDashboardController.swift (2), AntigravityStatusProbe.swift (2), MiniMaxUsageFetcher.swift (2). — One of this dimension's main actionable groups (57 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
418 duplicated block group(s) detected. 7.9 % of the production lines (23,176 of 293,209) are in a reported copy. A further 583 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 3 of the 1001 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 194 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 40 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with CostHistoryChartMenuView.swift (3), AlibabaCodingPlanSettingsReader.swift (2), IconRenderer.swift (2). — One of this dimension's main actionable groups (40 warning-level).
Resolve the 39 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with AmpUsageFetcher.swift (3), ClaudeAdminAPIUsageSnapshot.swift (2), ClaudeCredentialRouting.swift (2). — One of this dimension's main actionable groups (39 warning-level).
Resolve the 37 Edited copy of a member (11 corresponding lines) finding(s) in Code Duplication — start with CodexReconciledState.swift (2), ProviderDetailSection.swift, DarwinProcessEnumerator.swift. — One of this dimension's main actionable groups (37 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.5 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
11 production modules (SwiftPM), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 2 module(s) off the main sequence, with abstractness counted on 9 of the 11 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: AdaptiveRefreshCore · ×2
What to do
Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 7 Low cohesion finding(s) in Cohesion (LCOM4) — start with SettingsStore.swift, SidebarResizeHandle.swift, StatusItemController.swift. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality7.4 / 10Strong✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
126 skipped (7 with a documented reason), 205 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 2092 tests. Measured on the .swift suite only — at least 23 test source file(s) (.py, .mjs) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: · ×205TestsLinux/AntigravityJSONLNumberTests.swift:6
Resolve the 205 No assertions finding(s) in Test Quality — start with CLIEntryTests.swift (5), CodexWorkspacesConfigurationTests.swift (3), ProviderPluginDetailsParityTests.swift (2). — One of this dimension's main actionable groups (205 warning-level).
Resolve the 119 Skipped test finding(s) in Test Quality — start with MenuLayoutScreenshotRenderTests.swift (15), SpendDashboardScreenshotRenderTests.swift (8), OpenRouterNativeProofTests.swift (4). — One of this dimension's main actionable groups (119 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
3 outdated direct SwiftPM dependencies, 0 pinning defect(s). 6 of 7 direct dependencies had their releases listed (0 naming no readable repository, 1 pinned to a branch or a revision rather than a version). SwiftPM has no package registry: a dependency is a repository URL and its releases are that repository's semver tags, so currency is answered by listing tags rather than by querying an index. Only a newer tag on the SAME MAJOR is reported — a `from:` requirement admits everything below the next major and nothing above it, so a major crossing needs a Package.swift edit rather than an update, and naming the update as its remedy would be wrong. Whether any dependency is DEPRECATED or ABANDONED is not graded and cannot be: a repository publishes no such marker, and there is no registry that could carry one. Known CVEs in this dependency graph are D30's question.
Outdated: sweetcookiekit · ×3
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
22 secret(s) detected. 2 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.
REDACTED
What to do
Resolve the 22 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (22 issue-level).
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 8 SwiftPM package(s) use a banned license. SwiftPM has no package registry, so each package's licence is the one its repository declares: 7 of them read from the licence file the repository carries at the revision Package.resolved pins, and 1 — unpinned, or whose licence file could not be read or named — from api.deps.dev, which reports the licence the repository declares today. Graded: every package a committed Package.resolved pins, direct and transitive, and every declared dependency none pins. 1 of them declare no licence that matches a known SPDX licence; that is missing data, not a violation, and none of them is charged.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: Sources/CodexBarCore/CostUsageFetcher.swift (47×58=2726); Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift (38×49=1862); Sources/CodexBar/UsageStore/UsageStore+Refresh.swift (36×46=1656) Repeated repair below the complexity floor: Sources/CodexBar/CodexbarApp.swift (19 of 31 changes were fixes); Sources/CodexBarCore/Providers/ProviderUsagePresentation.swift (14 of 21 changes were fixes); Sources/CodexBarCore/Providers/Grok/GrokStatusProbe.swift (11 of 16 changes were fixes)
Resolve the 128 Hotspot finding(s) in Churn × Complexity Hotspots — start with CostUsageFetcher.swift, MenuBarLayoutRenderer.swift, UsageStore+Refresh.swift. — One of this dimension's main actionable groups (128 warning-level).
Resolve the 58 Repeated repair finding(s) in Churn × Complexity Hotspots — start with CodexbarApp.swift, ProviderUsagePresentation.swift, GrokStatusProbe.swift. — One of this dimension's main actionable groups (58 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.9 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
104 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Sources/CodexBarCore/CodexLocalProjectUsageModels.swift. Counted over 993 of the 1460 production source files in this repository: 466 are under the ~2,400-byte size floor this dimension measures over, and the remaining 1 have no attributable history left to measure.
Off-boarding risk: anonymized user #1 · ×3
Further sole-owners (lower concentration)
What to do
Resolve the 3 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
1 deducted task-comment markers across 293209 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 1 TodoComment finding(s) in Explicit Debt — start with FactoryStatusProbe.swift. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR Quality6.0 / 10Adequate✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
1 of 1 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
ADR has no Context sectiondocs/predictive-refresh-policy.md:9detected by adr-integrity
What to do
Resolve the 1 ADR has no Context section finding(s) in ADR Quality — start with predictive-refresh-policy.md. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
10 naming inconsistencies among 583 declarations measured against a convention their peers follow.
`webDebugDumpHtml` spells `Html` where 23 names in the project spell it `HTML`Sources/CodexBarCLI/CLIOptions.swift:205
`minimaxApiTokenRegex` spells `Api` where 205 names in the project spell it `API`Sources/CodexBarCore/Logging/LogRedactor.swift:23
`claudeAiOauth` spells `Ai` where 206 names in the project spell it `AI`Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentialModels.swift:126
`isApiOnly` spells `Api` where 205 names in the project spell it `API`Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:1479
`librariesApi` spells `Api` where 205 names in the project spell it `API`Sources/CodexBarCore/Providers/Mistral/MistralModels.swift:12
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 `webDebugDumpHtml` spells `Html` where 23 names in the project spell it… finding(s) in Naming Consistency — start with CLIOptions.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `minimaxApiTokenRegex` spells `Api` where 205 names in the project spell… finding(s) in Naming Consistency — start with LogRedactor.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `claudeAiOauth` spells `Ai` where 206 names in the project spell it `AI` finding(s) in Naming Consistency — start with ClaudeOAuthCredentialModels.swift. — 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.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
1 of 2 build units (SwiftPM) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
15 % of calls cross a namespace and 2 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
3 finding(s): 0 critical, 3 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 2 High secret finding(s) in Secrets (history) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
8 finding(s): 0 critical, 4 high, 4 medium, 0 low. semgrep hit a parse error in 46 file(s) — `.agents/skills/qa-test/scripts/live_provider_matrix.sh` (lines 56–66), `Scripts/analyze_quotio.sh` (lines 97–109), `Scripts/check-linux-cli-codex-cost-smoke.sh` (line 5), `Scripts/check-linux-cli-linkage.sh` (line 5), `Scripts/ci_linux_musl_build_gate.sh`, … (+41 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
What to do
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
21 of 994 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift. Counted over 994 of the 1460 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with StatusItemController+MenuViewportRestore.swift. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 20 Orphaned file finding(s) in Knowledge Freshness — start with GroqConsoleFetcher.swift, GroqConsoleSession.swift, ProviderPluginSelectedProfile.swift. — One of this dimension's main actionable groups (20 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 20 Change coupling finding(s) in Change Coupling — start with KeychainPromptCoordinator.swift (2), ProviderTokenResolver.swift (2), ProviderRegistry.swift (2). — One of this dimension's main actionable groups (20 warning-level).
Resolve the 8 Change-coupling hub finding(s) in Change Coupling — start with CursorProviderImplementation.swift, LogCategories.swift, StatusItemController+Menu.swift. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Domain Modelling — Whether domain identifiers are strongly typed (a typed-id struct) rather than raw primitives — consistency once an idiom exists.
Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.
Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.
`DockIconPresentationAttemptTracker.nextRawID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/DockIconController.swift:109
`Attempt.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/HomebrewUpdateNotifier.swift:16
`ProviderUsageItemID.metricID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/ProviderUsageItemVisibility.swift:10
`SessionEquivalentForecast.weeklyWindowID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/SessionEquivalentForecast.swift:20
`SessionEquivalentBurnCacheKey.weeklyWindowID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/SessionEquivalentForecast.swift:420
`QuotaWarningEvent.windowID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/SessionQuotaNotifications.swift:89
`Request.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/SessionUsageBrowser.swift:22
`Request.sessionID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/SessionUsageBrowser.swift:24
`DetailKey.sessionID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/SessionUsageBrowser.swift:44
`ShareStatsCurrencyPayload.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/ShareStatsPayload.swift:48
`WidgetVerifiedTokenSnapshot.widgetID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/WidgetAccountSnapshotStore.swift:6
`Point.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. (×4) — Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:24, Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:8, Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:32, …
`DetailRow.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:51
`QuotaWindow.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:47
`MenuBarLayoutConditional.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/MenuBarLayout.swift:287
`MenuBarLayoutConditionalDraft.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/MenuBarLayoutConditionalEditor.swift:11
`MenuBarLayoutPaletteGroup.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/MenuBarLayoutEditor.swift:256
`MenuBarLayoutRenderExtra.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:122
`Metric.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/MenuCardView.swift:34
`MenuUsageBarPoint.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/MenuUsageBarStrip.swift:10
`SeriesSelection.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:20
`VisibleSeries.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:30
`Row.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/ProviderAccountUsageOverview.swift:6
`Series.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/QuotaBurndownChartMenuView.swift:8
`Segment.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Menu/StorageBreakdownMenuView.swift:28
`Acknowledgement.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Settings/PreferencesAcknowledgements.swift:25
`ArgumentRow.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Settings/PreferencesHooksPane.swift:198
`PendingPluginApproval.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Settings/PreferencesPluginsPane.swift:328
`ModelLimitsIdentity.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Settings/PreferencesProviderDetailView.swift:12
`ProviderModelLimitDraft.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Settings/PreferencesProviderModelLimits.swift:5
`TeamAccountDraft.organizationID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Settings/PreferencesProviderSettingsRows.swift:222
`TeamAccountDraft.projectID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Settings/PreferencesProviderSettingsRows.swift:223
`ProviderSettingsConfirmationState.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Settings/PreferencesProvidersPane.swift:662
`Provider.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Settings/PreferencesSpendDashboardPane.swift:1252
`ProviderOrderUndo.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Settings/SettingsStore+ProviderBrowsing.swift:5
`SettingsDefaultsState.iCloudSyncDeviceID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/Settings/SettingsStoreState.swift:118
`MonthMarker.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/CodexBar/SpendDashboard/SpendActivityHeatmap.swift:707
What to do
Adopt the repo's typed-id idiom consistently — wrap every entity identity in its own typed id.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model7.6 / 10Strong✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour — a data-only reference entity whose logic lives in a foreign service is anemic. Rich models enforce their own invariants.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
`Entry` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside. — Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:490
`MetadataReadRecorder` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside. — Sources/CodexBarCore/Vendored/CostUsage/ModelsDevPricing.swift:505
`String` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside. — Sources/CodexBarCore/CodexThreadCatalogReader.swift:257
What to do
Move delegated behaviour onto the domain entity (or make it a value object); keep invariants inside the type.
Other · Domain Modelling — Whether a reference entity protects its own invariants — a class whose identity is a computed content hash but whose hashed fields are publicly mutable bypasses that invariant. Encapsulated state keeps identity-bearing fields immutable.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
1 ADR-shaped document(s) detected by content — `docs/predictive-refresh-policy.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
What to do
Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 7 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:6
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`sleep` is async and calls sleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — Sources/CodexBarCore/Providers/ProviderFetchPlan.swift:511
What to do
Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress.
Do you agree with this assessment?
R1 · Type Safety3.1 / 10Weak✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
45 typed · 98 plain JS — the untyped files are Integrations/Linux/Shared/Notifications.js, Integrations/Linux/Shared/Usage.js, Integrations/Omarchy/notifications.test.mjs, Integrations/Omarchy/test.mjs, Scripts/check-app-locales.mjs, Scripts/check-documentation-links.mjs (+92 more).
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
Sources/CodexBarCore/Resources/Plugins/chutes.js:90 · Sources/CodexBarCore/Resources/Plugins/chutes.ts:63 — the two spans are one implementation copied and then locally edited — 2370 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/chutes.js:90
Sources/CodexBarCore/Resources/Plugins/litellm.js:40 · Sources/CodexBarCore/Resources/Plugins/litellm.ts:12 — the two spans are one implementation copied and then locally edited — 2237 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/litellm.js:40
Sources/CodexBarCore/Resources/Plugins/muse.js:39 · Sources/CodexBarCore/Resources/Plugins/muse.ts:11 — the two spans are one implementation copied and then locally edited — 2198 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/muse.js:39
Sources/CodexBarCore/Resources/Plugins/huggingface.js:37 · Sources/CodexBarCore/Resources/Plugins/huggingface.ts:16 — the two spans are one implementation copied and then locally edited — 1862 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/huggingface.js:37
Sources/CodexBarCore/Resources/Plugins/aixy.js:22 · Sources/CodexBarCore/Resources/Plugins/aixy.ts:1 — these 2 files are line-for-line copies of one another — 166 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — Sources/CodexBarCore/Resources/Plugins/aixy.js:22
REDACTED:40 · REDACTED:12 — the two spans are one implementation copied and then locally edited — 1301 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:40
Sources/CodexBarCore/Resources/Plugins/bifrost.js:39 · Sources/CodexBarCore/Resources/Plugins/bifrost.ts:11 — the two spans are one implementation copied and then locally edited — 1403 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/bifrost.js:39
Sources/CodexBarCore/Resources/Plugins/munito.js:15 · Sources/CodexBarCore/Resources/Plugins/munito.ts:8 — the two spans are one implementation copied and then locally edited — 1200 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/munito.js:15
Sources/CodexBarCore/Resources/Plugins/claudeplatform.js:8 · Sources/CodexBarCore/Resources/Plugins/claudeplatform.ts:1 — these 2 files are line-for-line copies of one another — 138 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — Sources/CodexBarCore/Resources/Plugins/claudeplatform.js:8
Sources/CodexBarCore/Resources/Plugins/qwencloud-team.js:37 · Sources/CodexBarCore/Resources/Plugins/qwencloud-team.ts:9 — the two spans are one implementation copied and then locally edited — 1160 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/qwencloud-team.js:37
Sources/CodexBarCore/Resources/Plugins/v0.js:52 · Sources/CodexBarCore/Resources/Plugins/v0.ts:24 — the two spans are one implementation copied and then locally edited — 1111 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/v0.js:52
Sources/CodexBarCore/Resources/Plugins/helmcode.js:58 · Sources/CodexBarCore/Resources/Plugins/helmcode.ts:32 — the two spans are one implementation copied and then locally edited — 1176 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/helmcode.js:58
Sources/CodexBarCore/Resources/Plugins/typesafe.js:23 · Sources/CodexBarCore/Resources/Plugins/typesafe.ts:3 — the two spans are one implementation copied and then locally edited — 1017 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/typesafe.js:23
Sources/CodexBarCore/Resources/Plugins/raycast.js:8 · Sources/CodexBarCore/Resources/Plugins/raycast.ts:1 — these 2 files are line-for-line copies of one another — 104 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — Sources/CodexBarCore/Resources/Plugins/raycast.js:8
Sources/CodexBarCore/Resources/Plugins/clinepass.js:33 · Sources/CodexBarCore/Resources/Plugins/clinepass.ts:22 — the two spans are one implementation copied and then locally edited — 624 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/clinepass.js:33
Sources/CodexBarCore/Resources/Plugins/llmproxy.js:8 · Sources/CodexBarCore/Resources/Plugins/llmproxy.ts:1 — these 2 files are line-for-line copies of one another — 93 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — Sources/CodexBarCore/Resources/Plugins/llmproxy.js:8
REDACTED:18 · REDACTED:11 — the two spans are one implementation copied and then locally edited — 945 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:18
Sources/CodexBarCore/Resources/Plugins/gitkraken.js:41 · Sources/CodexBarCore/Resources/Plugins/gitkraken.ts:14 — the two spans are one implementation copied and then locally edited — 809 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/gitkraken.js:41
Sources/CodexBarCore/Resources/Plugins/abacus.js:8 · Sources/CodexBarCore/Resources/Plugins/abacus.ts:1 — these 2 files are line-for-line copies of one another — 89 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — Sources/CodexBarCore/Resources/Plugins/abacus.js:8
Sources/CodexBarCore/Resources/Plugins/workbuddy.js:219 · Sources/CodexBarCore/Resources/Plugins/workbuddy.ts:222 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — Sources/CodexBarCore/Resources/Plugins/workbuddy.js:219
Sources/CodexBarCore/Resources/Plugins/futureagi.js:39 · Sources/CodexBarCore/Resources/Plugins/futureagi.ts:11 — the two spans are one implementation copied and then locally edited — 675 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/futureagi.js:39
Sources/CodexBarCore/Resources/Plugins/lithosai.js:8 · Sources/CodexBarCore/Resources/Plugins/lithosai.ts:1 — these 2 files are line-for-line copies of one another — 85 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — Sources/CodexBarCore/Resources/Plugins/lithosai.js:8
Sources/CodexBarCore/Resources/Plugins/llmman.js:31 · Sources/CodexBarCore/Resources/Plugins/llmman.ts:10 — the two spans are one implementation copied and then locally edited — 863 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/llmman.js:31
Sources/CodexBarCore/Resources/Plugins/bifrost.js:276 · Sources/CodexBarCore/Resources/Plugins/bifrost.ts:237 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — Sources/CodexBarCore/Resources/Plugins/bifrost.js:276
Sources/CodexBarCore/Resources/Plugins/devpass.js:36 · Sources/CodexBarCore/Resources/Plugins/devpass.ts:8 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — Sources/CodexBarCore/Resources/Plugins/devpass.js:36
Sources/CodexBarCore/Resources/Plugins/gemini-web.js:47 · Sources/CodexBarCore/Resources/Plugins/gemini-web.ts:28 — the two spans are one implementation copied and then locally edited — 643 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/gemini-web.js:47
REDACTED:1 · REDACTED:1 — these 2 files are line-for-line copies of one another — 73 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — REDACTED:1
Sources/CodexBarCore/Resources/Plugins/langdock.js:1 · Sources/CodexBarCore/Resources/Plugins/langdock.ts:1 — these 2 files are line-for-line copies of one another — 69 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — Sources/CodexBarCore/Resources/Plugins/langdock.js:1
Sources/CodexBarCore/Resources/Plugins/workbuddy.js:81 · Sources/CodexBarCore/Resources/Plugins/workbuddy.ts:80 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — Sources/CodexBarCore/Resources/Plugins/workbuddy.js:81
Sources/CodexBarCore/Resources/Plugins/ollama-api.js:37 · Sources/CodexBarCore/Resources/Plugins/ollama-api.ts:16 — the two spans are one implementation copied and then locally edited — 595 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/ollama-api.js:37
Sources/CodexBarCore/Resources/Plugins/parallel.js:15 · Sources/CodexBarCore/Resources/Plugins/parallel.ts:8 — the two spans are one implementation copied and then locally edited — 522 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/parallel.js:15
Sources/CodexBarCore/Resources/Plugins/sofya.js:8 · Sources/CodexBarCore/Resources/Plugins/sofya.ts:1 — these 2 files are line-for-line copies of one another — 58 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — Sources/CodexBarCore/Resources/Plugins/sofya.js:8
REDACTED:1 · REDACTED:1 — these 2 files are line-for-line copies of one another — 57 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — REDACTED:1
Sources/CodexBarCore/Resources/Plugins/siliconflow.js:1 · Sources/CodexBarCore/Resources/Plugins/siliconflow.ts:1 — these 2 files are line-for-line copies of one another — 56 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — Sources/CodexBarCore/Resources/Plugins/siliconflow.js:1
Sources/CodexBarCore/Resources/Plugins/xkiro.js:36 · Sources/CodexBarCore/Resources/Plugins/xkiro.ts:8 — the two spans are one implementation copied and then locally edited — 549 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — Sources/CodexBarCore/Resources/Plugins/xkiro.js:36
REDACTED:11 · REDACTED:11 — the two spans are one implementation copied and then locally edited — 438 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:11
Sources/CodexBarCore/Resources/Plugins/hyper.js:46 · Sources/CodexBarCore/Resources/Plugins/hyper.ts:25 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — Sources/CodexBarCore/Resources/Plugins/hyper.js:46
Sources/CodexBarCore/Resources/Plugins/zoommate.js:261 · Sources/CodexBarCore/Resources/Plugins/zoommate.ts:204 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — Sources/CodexBarCore/Resources/Plugins/zoommate.js:261
Sources/CodexBarCore/Resources/Plugins/workbuddy.js:167 · Sources/CodexBarCore/Resources/Plugins/workbuddy.ts:170 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — Sources/CodexBarCore/Resources/Plugins/workbuddy.js:167
Sources/CodexBarCore/Resources/Plugins/aiand.js:67 · Sources/CodexBarCore/Resources/Plugins/aiand.ts:27 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — Sources/CodexBarCore/Resources/Plugins/aiand.js:67
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
fetchUsage has cyclomatic complexity 116 and cognitive complexity 202; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/openrouter.js:24
fetchUsage has cyclomatic complexity 75 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/zai.js:24
fetchUsage has cyclomatic complexity 62 and cognitive complexity 87; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/openai.js:14
fetchUsage has cyclomatic complexity 60 and cognitive complexity 114; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/zoommate.ts:18
fetchUsage has cyclomatic complexity 59 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:11
fetchUsage has cyclomatic complexity 58 and cognitive complexity 87; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/huggingface.ts:16
fetchUsage has cyclomatic complexity 57 and cognitive complexity 74; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/poe.js:15
fetchUsage has cyclomatic complexity 55 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:39
fetchUsage has cyclomatic complexity 54 and cognitive complexity 108; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/zoommate.js:53
fetchUsage has cyclomatic complexity 54 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/huggingface.js:37
fetchUsage has cyclomatic complexity 52 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/sub2api.js:10
fetchUsage has cyclomatic complexity 50 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/litellm.ts:12
fetchUsage has cyclomatic complexity 50 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/munito.ts:8
fetchUsage has cyclomatic complexity 45 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/munito.js:15
fetchUsage has cyclomatic complexity 44 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — REDACTED:11, REDACTED:11
fetchUsage has cyclomatic complexity 44 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:10
fetchUsage has cyclomatic complexity 43 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:11
fetchUsage has cyclomatic complexity 41 and cognitive complexity 73; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/workbuddy.ts:19
fetchUsage has cyclomatic complexity 41 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/litellm.js:40
fetchUsage has cyclomatic complexity 41 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/t3chat.js:12
fetchUsage has cyclomatic complexity 41 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/perplexity.js:8
fetchUsage has cyclomatic complexity 39 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — Sources/CodexBarCore/Resources/Plugins/qwencloud-team.ts:9, Sources/CodexBarCore/Resources/Plugins/zed.js:12
fetchUsage has cyclomatic complexity 39 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:11
fetchUsage has cyclomatic complexity 38 and cognitive complexity 72; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/claudeplatform.ts:14
fetchUsage has cyclomatic complexity 38 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:15
fetchUsage has cyclomatic complexity 37 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/workbuddy.js:26
fetchUsage has cyclomatic complexity 37 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/qwencloud-team.js:37
fetchUsage has cyclomatic complexity 37 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/raycast.ts:8
(anonymous) has cyclomatic complexity 37 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — Sources/CodexBarCore/Resources/Plugins/aixy.js:111, Sources/CodexBarCore/Resources/Plugins/aixy.ts:90
fetchUsage has cyclomatic complexity 35 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/longcat.ts:9
fetchUsage has cyclomatic complexity 35 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/raycast.js:15
fetchUsage has cyclomatic complexity 33 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/CodexBarCore/Resources/Plugins/claudeplatform.js:21
fetchUsage has cyclomatic complexity 33 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:11
fetchUsage has cyclomatic complexity 32 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — Sources/CodexBarCore/Resources/Plugins/replicate.js:29, Sources/CodexBarCore/Resources/Plugins/replicate.ts:8
fetchUsage has cyclomatic complexity 32 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — Sources/CodexBarCore/Resources/Plugins/hyper.js:32, Sources/CodexBarCore/Resources/Plugins/hyper.ts:11
Do you agree with this assessment?
R3 · Large Files9.2 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
Integrations/Omarchy/test.mjs has 771 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — Integrations/Omarchy/test.mjs:1
Sources/CodexBarCore/Resources/Plugins/openrouter.js has 431 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — Sources/CodexBarCore/Resources/Plugins/openrouter.js:1
Sources/CodexBarCore/Resources/Plugins/openai.js has 409 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — Sources/CodexBarCore/Resources/Plugins/openai.js:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage0.2 / 10Critical✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — Sources/CodexBarCore/Resources/Plugins/chutes.js:1, Sources/CodexBarCore/Resources/Plugins/openrouter.js:1, Sources/CodexBarCore/Resources/Plugins/openai.js:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
Do you agree with this assessment?
R7 · Dead Code0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 26 application, 14 tooling and 6 test entry point(s) detected in this repo. This repository declares no build, type-check or test script, so nothing here would fail on a wrong deletion — confirm by hand that nothing loads each file (including by a path built at runtime) before removing it. An undetected custom entry would make these reachable.
no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×39) — Sources/CodexBarCore/Resources/Plugins/chutes.js, Sources/CodexBarCore/Resources/Plugins/openrouter.js, Sources/CodexBarCore/Resources/Plugins/openai.js, …
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×35) — Sources/CodexBarCore/AppGroupSupport.swift:173, Sources/CodexBarCore/CodexLaunchPreflight+SignatureIdentity.swift:20, Sources/CodexBarCore/CopilotUsageModels.swift:258, …
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×5) — REDACTED:121, Sources/CodexBarCore/Resources/Plugins/poe.js:106, Sources/CodexBarCore/Resources/Plugins/t3chat.js:70, …
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~2.3 `!` null assertions per 1k TypeScript source lines — 15 assertion(s) across the 6547 source line(s) of the 45 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: Sources/CodexBarCore/Resources/Plugins/aixy.ts (7), Sources/CodexBarCore/Resources/Plugins/litellm.ts (3), Sources/CodexBarCore/Resources/Plugins/bifrost.ts (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 22 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 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: this repository stores data through 'SQLite3' (Sources/CodexBarCore/CodexThreadCatalogReader.swift:3) but declares no persisted model this check reads (SwiftData @Model, Core Data, Realm, GRDB and Fluent types, GRDB and SQLite.swift columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'SQLite3' (Sources/CodexBarCore/CodexThreadCatalogReader.swift:3) but declares no persisted model this check reads (SwiftData @Model, Core Data NSManagedObject, Realm Object, GRDB record and Fluent Model properties, GRDB and SQLite.swift columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 69 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — Frontend below the scale floor (3 DOM element(s) < 25) — too little surface to assess accessibility.
AC2 Forms & labels — Frontend below the scale floor (3 DOM element(s) < 25) — too little surface to assess accessibility.
AC3 Page structure — Frontend below the scale floor (3 DOM element(s) < 25) — too little surface to assess accessibility.
AC4 Keyboard semantics — Frontend below the scale floor (3 DOM element(s) < 25) — too little surface to assess accessibility.
AC5 ARIA correctness — Frontend below the scale floor (3 DOM element(s) < 25) — too little surface to assess accessibility.
AC6 Visual & motion safety — Frontend below the scale floor (3 DOM element(s) < 25) — too little surface to assess accessibility.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No 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. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — no exported interface declares behaviour
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
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.
D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
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.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
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) — 377 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
D8 Code Coverage — Coverage not measured — Swift suite
DM1 Aggregate boundaries — not scored for Swift: the sidecar flattens array/collection types (a child COLLECTION = legitimate membership vs a single embedded aggregate is indistinguishable), and aggregate-vs-value-object classification cannot be told apart in source (every struct-holding-struct reads alike) — reported as guidance rather than measured
DM3 Integration-event coupling — not scored for Swift: a cross-SwiftPM-target domain leak cannot be told apart in source from a legitimate shared-kernel/contracts module, and most repositories ship a single module — reported as guidance rather than measured
DM6 Domain ↔ infrastructure boundary — this Swift package maps no type to a persistence framework and declares no domain-model type carrying a method of its own, so DM6's domain↔infrastructure boundary read has no population to be taken over
DM7 Repository granularity — not scored for Swift: 'a repository per CHILD entity' needs the aggregate-root structure, which is not source-resolvable — reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Python, Swift 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 file importing package-benchmark, or package-benchmark in Package.swift, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
R6 Tooling — no package.json in the repository — test/lint/typecheck wiring is read from package.json scripts (corroborated against CI), so this project's own toolchain isn't measured here
R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
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 — X1 reached only 9% of this repository's production lines — swift (284,562 lines), cpp (655 lines), c (178 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X12 Unreachable branch — X12 reached only 9% of this repository's production lines — swift (284,562 lines), cpp (655 lines), c (178 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
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
X16 Unfloored truncation loop — X16 reached only 8% of this repository's production lines — swift (284,562 lines), python (2,213 lines), cpp (655 lines), c (178 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X21 Side-effecting pattern guard — X21 reached only 9% of this repository's production lines — swift (284,562 lines), cpp (655 lines), c (178 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — X27 reached only 1% of this repository's production lines — swift (284,562 lines), javascript (19,758 lines), typescript (6,434 lines), cpp (655 lines), c (178 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X29 Per-element action decided by a fixed element — X29 reached only 8% of this repository's production lines — swift (284,562 lines), python (2,213 lines), cpp (655 lines), c (178 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — 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
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Critical — 73 finding(s)
DM2 · Strongly-typed ids· Raw-primitive id despite a typed-id idiom · ×40
Raw-primitive id despite a typed-id idiom: DockIconPresentationAttemptTracker.nextRawID Sources/CodexBar/DockIconController.swift:109— `DockIconPresentationAttemptTracker.nextRawID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Attempt.id Sources/CodexBar/HomebrewUpdateNotifier.swift:16— `Attempt.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: ProviderUsageItemID.metricID Sources/CodexBar/ProviderUsageItemVisibility.swift:10— `ProviderUsageItemID.metricID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: SessionEquivalentForecast.weeklyWindowID Sources/CodexBar/SessionEquivalentForecast.swift:20— `SessionEquivalentForecast.weeklyWindowID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: SessionEquivalentBurnCacheKey.weeklyWindowID Sources/CodexBar/SessionEquivalentForecast.swift:420— `SessionEquivalentBurnCacheKey.weeklyWindowID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: QuotaWarningEvent.windowID Sources/CodexBar/SessionQuotaNotifications.swift:89— `QuotaWarningEvent.windowID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Request.id Sources/CodexBar/SessionUsageBrowser.swift:22— `Request.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Request.sessionID Sources/CodexBar/SessionUsageBrowser.swift:24— `Request.sessionID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: DetailKey.sessionID Sources/CodexBar/SessionUsageBrowser.swift:44— `DetailKey.sessionID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: ShareStatsCurrencyPayload.id Sources/CodexBar/ShareStatsPayload.swift:48— `ShareStatsCurrencyPayload.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: WidgetVerifiedTokenSnapshot.widgetID Sources/CodexBar/WidgetAccountSnapshotStore.swift:6— `WidgetVerifiedTokenSnapshot.widgetID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Point.id Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:24— `Point.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: DetailRow.id Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:51— `DetailRow.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Point.id Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:8— `Point.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Point.id Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:32— `Point.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: QuotaWindow.id Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:47— `QuotaWindow.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: MenuBarLayoutConditional.id Sources/CodexBar/Menu/MenuBarLayout.swift:287— `MenuBarLayoutConditional.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: MenuBarLayoutConditionalDraft.id Sources/CodexBar/Menu/MenuBarLayoutConditionalEditor.swift:11— `MenuBarLayoutConditionalDraft.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: MenuBarLayoutPaletteGroup.id Sources/CodexBar/Menu/MenuBarLayoutEditor.swift:256— `MenuBarLayoutPaletteGroup.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: MenuBarLayoutRenderExtra.id Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:122— `MenuBarLayoutRenderExtra.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Metric.id Sources/CodexBar/Menu/MenuCardView.swift:34— `Metric.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: MenuUsageBarPoint.id Sources/CodexBar/Menu/MenuUsageBarStrip.swift:10— `MenuUsageBarPoint.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: SeriesSelection.id Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:20— `SeriesSelection.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: VisibleSeries.id Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:30— `VisibleSeries.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Row.id Sources/CodexBar/Menu/ProviderAccountUsageOverview.swift:6— `Row.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
DM4 · Rich vs anemic domain model· Anemic domain model · ×3
Anemic domain model: Entry Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:490— `Entry` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
Anemic domain model: MetadataReadRecorder Sources/CodexBarCore/Vendored/CostUsage/ModelsDevPricing.swift:505— `MetadataReadRecorder` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
Anemic domain model: String Sources/CodexBarCore/CodexThreadCatalogReader.swift:257— `String` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
Orphaned knowledge Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
No assertions: TestsLinux/AntigravityJSONLNumberTests.swift:6— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsLinux/CLIHooksWatchSleepLinuxTests.swift:7— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsLinux/CostUsageJsonlDifferentialTests.swift:58— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsLinux/CursorCSVTrailingColumnsTests.swift:6— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsLinux/DashboardAccountInventoryTests.swift:7— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsLinux/DashboardClaudeSwapCollectionTests.swift:7— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsLinux/DeepInfraSetupTests.swift:8— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsLinux/KimiDesktopDispatchTests.swift:23— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsLinux/OpenAIDashboardImportModelsTests.swift:7— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsLinux/PerplexityCreditFormattingTests.swift:9— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsLinux/ProviderNumericBoundaryTests.swift:6— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/AbliterationPluginTests.swift:9— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/AixyPluginTests.swift:165— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/GeminiWebPluginTests.swift:19— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/GitKrakenPluginTests.swift:19— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/HostResultProviderTests.swift:14— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/HyperPluginTests.swift:49— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/LithosAIPluginTests.swift:11— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/NotionPluginTests.swift:24— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/OpenDesignPluginTests.swift:32— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/ProviderPluginCookieHeaderEchoTests.swift:9— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/ProviderPluginCookieJarTests.swift:12— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/ProviderPluginCurrencyTests.swift:6— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/ProviderPluginDetailsParityTests.swift:15— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestsPlugin/ProviderPluginEngineBenchmarkTests.swift:16— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
Hotspot: Sources/CodexBarCore/CostUsageFetcher.swift Sources/CodexBarCore/CostUsageFetcher.swift:493— Sources/CodexBarCore/CostUsageFetcher.swift changed 47 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in CostUsageFetcher.loadTokenResult at line 493. 26 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/CostUsageFetcher.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:431— Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in MenuBarLayoutRenderer.renderUncached at line 431. 2 of those changes were fix/bug commits, and the other 36 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/UsageStore/UsageStore+Refresh.swift Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:1305— Sources/CodexBar/UsageStore/UsageStore+Refresh.swift changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in UsageStore.handleProviderFetchFailure at line 1305. 1 of those changes was a fix/bug commit, and the other 35 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/UsageStore/UsageStore+Refresh.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:459— Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 129 in TTYCommandRunner.run at line 459. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/StatusItem/StatusItemController+Animation.swift Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:361— Sources/CodexBar/StatusItem/StatusItemController+Animation.swift changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in StatusItemController.applyIcon at line 361. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/StatusItem/StatusItemController+Animation.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBarCore/Resources/Plugins/openrouter.js Sources/CodexBarCore/Resources/Plugins/openrouter.js:24— Sources/CodexBarCore/Resources/Plugins/openrouter.js changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 116 in fetchUsage at line 24. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Resources/Plugins/openrouter.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/StatusItem/StatusItemController+Menu.swift Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:222— Sources/CodexBar/StatusItem/StatusItemController+Menu.swift changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in StatusItemController.populateMenu at line 222. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/StatusItem/StatusItemController+Menu.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:583— Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in SpendDashboardModel.buildCurrencyGroup at line 583. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/UsageStore/UsageStore.swift Sources/CodexBar/UsageStore/UsageStore.swift:1428— Sources/CodexBar/UsageStore/UsageStore.swift changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in UsageStore.refreshTokenUsage at line 1428. 2 of those changes were fix/bug commits, and the other 46 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/UsageStore/UsageStore.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBarCore/Plugins/ProviderPluginManifest.swift Sources/CodexBarCore/Plugins/ProviderPluginManifest.swift:133— Sources/CodexBarCore/Plugins/ProviderPluginManifest.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in ProviderPluginManifest.init at line 133. 3 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Plugins/ProviderPluginManifest.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/Menu/MenuCardView.swift Sources/CodexBar/Menu/MenuCardView.swift:1397— Sources/CodexBar/Menu/MenuCardView.swift changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in Model.secondaryMetric at line 1397. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/Menu/MenuCardView.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:948— Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in Model.extraRateWindowMetrics at line 948. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Integrations/Linux/Shared/Usage.js Integrations/Linux/Shared/Usage.js:39— Integrations/Linux/Shared/Usage.js changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in Usage.rows at line 39. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Integrations/Linux/Shared/Usage.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:150— Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in UsageStore.refreshCodexVisibleAccountsForMenu at line 150. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/UsageStore/UsageStore+WidgetSnapshot.swift Sources/CodexBar/UsageStore/UsageStore+WidgetSnapshot.swift:256— Sources/CodexBar/UsageStore/UsageStore+WidgetSnapshot.swift changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in UsageStore.makeWidgetEntry at line 256. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/UsageStore/UsageStore+WidgetSnapshot.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBarCLI/CLICostCommand.swift Sources/CodexBarCLI/CLICostCommand.swift:363— Sources/CodexBarCLI/CLICostCommand.swift changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in CodexBarCLI.topCostModelLines at line 363. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCLI/CLICostCommand.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:639— Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in JavaScriptCoreProviderPluginEngine.makeContext at line 639. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/SpendDashboard/SpendDashboardController.swift Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:223— Sources/CodexBar/SpendDashboard/SpendDashboardController.swift changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in SpendDashboardSource.makeRequest at line 223. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/SpendDashboard/SpendDashboardController.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/Menu/MenuBarLayout.swift Sources/CodexBar/Menu/MenuBarLayout.swift:1414— Sources/CodexBar/Menu/MenuBarLayout.swift changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in MenuBarLayoutPersistence.preferredLibrary at line 1414. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/Menu/MenuBarLayout.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:145— Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in ClaudeCLISession.captureExclusive at line 145. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/UsageStore/UsageStore+MenuCardModel.swift Sources/CodexBar/UsageStore/UsageStore+MenuCardModel.swift:55— Sources/CodexBar/UsageStore/UsageStore+MenuCardModel.swift changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in UsageStore.menuCardInput at line 55. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/UsageStore/UsageStore+MenuCardModel.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift:393— Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in UsageStore.hydrateCachedTokenSnapshots at line 393. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBarCore/PiSessionCostScanner.swift Sources/CodexBarCore/PiSessionCostScanner.swift:155— Sources/CodexBarCore/PiSessionCostScanner.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in PiSessionCostScanner.loadDailyReportResultCancellable at line 155. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/PiSessionCostScanner.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Scripts/ci_swift_test_by_suite.py Scripts/ci_swift_test_by_suite.py:250— Scripts/ci_swift_test_by_suite.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in TestProcessOwnership.refresh at line 250. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Scripts/ci_swift_test_by_suite.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:544— Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in QuickJSProviderPluginEngine.handleHostCall at line 544. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
FileTooLong: ClaudeOAuth/ClaudeOAuthCredentials.swift Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift— FileTooLong — 2386 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: ClaudeOAuthCredentialsStore (14-3208). The bar is 500 significant lines; this is 1886 over it, 4.77× 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: CodexBarCore/CostUsageFetcher.swift Sources/CodexBarCore/CostUsageFetcher.swift— FileTooLong — 1716 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: CostUsageFetcher (31-2041). The bar is 500 significant lines; this is 1216 over it, 3.43× 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: SpendDashboard/SpendDashboardController.swift Sources/CodexBar/SpendDashboard/SpendDashboardController.swift— FileTooLong — 1485 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 985 over it, 2.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: SpendDashboard/SpendDashboardModel.swift Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift— FileTooLong — 1273 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: SpendDashboardModel (22-1632). The bar is 500 significant lines; this is 773 over it, 2.55× 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: StatusItem/StatusItemController+Menu.swift Sources/CodexBar/StatusItem/StatusItemController+Menu.swift— FileTooLong — 1260 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 760 over it, 2.52× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: CodexBarCore/CostUsageModels.swift Sources/CodexBarCore/CostUsageModels.swift— FileTooLong — 1258 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 758 over it, 2.52× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: UsageStore/UsageStore+TokenAccounts.swift Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift— FileTooLong — 1256 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 756 over it, 2.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: UsageStore/UsageStore.swift Sources/CodexBar/UsageStore/UsageStore.swift— FileTooLong — 1240 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 740 over it, 2.48× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Menu/MenuBarLayoutRenderer.swift Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift— FileTooLong — 1234 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: MenuBarLayoutRenderer (311-1345). The bar is 500 significant lines; this is 734 over it, 2.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: Codex/UsageStore+OpenAIWeb.swift Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift— FileTooLong — 1234 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 734 over it, 2.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: CodexBarCLI/CLIServeCommand.swift Sources/CodexBarCLI/CLIServeCommand.swift— FileTooLong — 1225 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 725 over it, 2.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: UsageStore/UsageStore+Refresh.swift Sources/CodexBar/UsageStore/UsageStore+Refresh.swift— FileTooLong — 1224 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 724 over it, 2.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: CodexBarCore/UsageFetcher.swift Sources/CodexBarCore/UsageFetcher.swift— FileTooLong — 1223 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 723 over it, 2.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Antigravity/AntigravityStatusProbe.swift Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift— FileTooLong — 1217 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 717 over it, 2.43× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Menu/MenuCardView.swift Sources/CodexBar/Menu/MenuCardView.swift— FileTooLong — 1185 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 685 over it, 2.37× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: UsageStore/UsageStore+PlanUtilization.swift Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift— FileTooLong — 1139 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 639 over it, 2.28× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Sync/CloudSyncEngine.swift Sources/CodexBar/Sync/CloudSyncEngine.swift— FileTooLong — 1118 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 618 over it, 2.24× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Claude/ClaudeStatusProbe.swift Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift— FileTooLong — 1116 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 616 over it, 2.23× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Kiro/KiroStatusProbe.swift Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift— FileTooLong — 1103 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 603 over it, 2.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Menu/MenuBarLayout.swift Sources/CodexBar/Menu/MenuBarLayout.swift— FileTooLong — 1096 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 596 over it, 2.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: MiniMax/MiniMaxUsageFetcher.swift Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift— FileTooLong — 1096 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 596 over it, 2.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Claude/ClaudeUsageFetcher.swift Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift— FileTooLong — 1090 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 590 over it, 2.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Settings/PreferencesSpendDashboardPane.swift Sources/CodexBar/Settings/PreferencesSpendDashboardPane.swift— FileTooLong — 1067 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 567 over it, 2.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: CodexBarCore/PiSessionCostScanner.swift Sources/CodexBarCore/PiSessionCostScanner.swift— FileTooLong — 1063 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: PiSessionCostScanner (20-1306). 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: ClaudeWeb/ClaudeWebAPIFetcher.swift Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift— FileTooLong — 1063 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 563 over it, 2.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
MethodTooLong: IconRenderer.makeIcon Sources/CodexBar/IconRenderer.swift:142— MethodTooLong — makeIcon runs 585 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 485 over it, 5.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TTYCommandRunner.run Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:459— MethodTooLong — run runs 433 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 333 over it, 4.33× 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: CostUsageFetcher.loadTokenResult Sources/CodexBarCore/CostUsageFetcher.swift:493— MethodTooLong — loadTokenResult runs 316 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 216 over it, 3.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: DebugPane.body Sources/CodexBar/Settings/PreferencesDebugPane.swift:30— MethodTooLong — body runs 275 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 175 over it, 2.75× 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: CostHistoryChartMenuView.body Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:119— MethodTooLong — body runs 237 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× 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: SettingsStore.loadDefaultsState Sources/CodexBar/Settings/SettingsStore.swift:533— MethodTooLong — loadDefaultsState runs 203 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 103 over it, 2.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CodexBarCLI.fetchUsageOutput Sources/CodexBarCLI/CLIUsageCommand.swift:423— MethodTooLong — fetchUsageOutput runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× 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: ProviderPluginManifest.init Sources/CodexBarCore/Plugins/ProviderPluginManifest.swift:133— MethodTooLong — init runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× 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: ProviderSettingsTokenAccountsRowView.body Sources/CodexBar/Settings/PreferencesProviderSettingsRows.swift:248— MethodTooLong — body runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× 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: StatusItemController.applyIcon Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:361— MethodTooLong — applyIcon runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× 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: CodexLocalProjectUsageIndexer.buildSnapshotFromCostCache Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:153— MethodTooLong — buildSnapshotFromCostCache runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CostUsageFetcher.loadCachedCodexTokenSnapshotResult Sources/CodexBarCore/CostUsageFetcher.swift:1418— MethodTooLong — loadCachedCodexTokenSnapshotResult runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× 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: UsageStore.codexOutcomeAdmittedForPublication Sources/CodexBar/Providers/Codex/UsageStore+CodexWeeklyResetConfirmation.swift:31— MethodTooLong — codexOutcomeAdmittedForPublication runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StatusItemController.populateMenu Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:222— MethodTooLong — populateMenu runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: UsageStore.limitResetDetectorTransition Sources/CodexBar/UsageStore/UsageStore+LimitResetCelebration.swift:301— MethodTooLong — limitResetDetectorTransition runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CodexRequestLedger.load Sources/CodexBarCore/Providers/Codex/CodexRequestLedger.swift:111— MethodTooLong — load runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× 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: JavaScriptCoreProviderPluginEngine.makeContext Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:639— MethodTooLong — makeContext runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× 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: UsageStore.refreshCodexVisibleAccountsForMenu Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:150— MethodTooLong — refreshCodexVisibleAccountsForMenu runs 135 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× 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: PiFamilySessionScanner.costSessionRoots Sources/CodexBarCore/PiFamilySessionScanner.swift:391— MethodTooLong — costSessionRoots runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BurnChartCanvas.body Sources/CodexBarWidget/BurnDownWidgetViews.swift:320— MethodTooLong — body runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× 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: AmpUsageParser.parse Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift:20— MethodTooLong — parse 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: PiSessionCostScanner.loadDailyReportResultCancellable Sources/CodexBarCore/PiSessionCostScanner.swift:155— MethodTooLong — loadDailyReportResultCancellable runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× 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: PiSessionCostScanner.parsePiSessionFile Sources/CodexBarCore/PiSessionCostScanner.swift:832— MethodTooLong — parsePiSessionFile runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× 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: SettingsStore.init Sources/CodexBar/Settings/SettingsStore.swift:310— MethodTooLong — init runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: UsageStore.refreshProviderPass Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:294— MethodTooLong — refreshProviderPass runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Repeated repair: Sources/CodexBar/CodexbarApp.swift Sources/CodexBar/CodexbarApp.swift:695— Sources/CodexBar/CodexbarApp.swift changed 31 times in last 90 days and 19 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is AppDelegate.ensureSingleSettingsApplicationMenuItem at line 695), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webkit): guard cold website store enumeration”; “fix(codex): reclaim WebKit caches and retired account stores”; “fix(updates): separate automatic installs from automatic checks (#4778)”; “fix(widgets): replace a stale widget extension after an update (#4663)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/CodexbarApp.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/ProviderUsagePresentation.swift Sources/CodexBarCore/Providers/ProviderUsagePresentation.swift:654— Sources/CodexBarCore/Providers/ProviderUsagePresentation.swift changed 21 times in last 90 days and 14 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is ProviderUsagePresentation.window at line 654), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(claude): show prepaid usage credits in menu bar Balance layouts”; “fix(menu): map Nous Portal credit rows to the menu bar balance (#4319)”; “fix(providers): clarify Kimi and z.ai quota availability (#4091)”; “fix(mistral): keep widget selection provider-owned”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/ProviderUsagePresentation.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Grok/GrokStatusProbe.swift Sources/CodexBarCore/Providers/Grok/GrokStatusProbe.swift:153— Sources/CodexBarCore/Providers/Grok/GrokStatusProbe.swift changed 16 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is GrokStatusProbe.fetch at line 153), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(grok): keep the weekly Credits window on a zero-usage week (#4679)”; “fix(grok): use the _x.ai/billing ACP method for CLI billing (#4595)”; “fix(grok): classify missing billing methods by RPC code (#3947)”; “fix(grok): preserve measured billing periods for pace (#3679)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Grok/GrokStatusProbe.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift:492— Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift changed 15 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is CodexOAuthFetchStrategy.shouldFallback at line 492), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(charts): preserve zero-usage calendar days for every provider (#4689)”; “fix(codex): open the usage dashboard on its overview tab (#4607)”; “fix(codex): reread fresh credentials and invalidate stale plan evidence (#4088)”; “fix(codex): verify the registered usage dashboard URL”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/BrowserCookieAccessGate.swift Sources/CodexBarCore/BrowserCookieAccessGate.swift:108— Sources/CodexBarCore/BrowserCookieAccessGate.swift changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is BrowserCookieAccessGate.shouldAttemptWithPolicy at line 108), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(muse): earn the Keychain grant on manual refresh (#4489)”; “fix(cookies): explain Files & Folders denial instead of Sign in (#4482)”; “fix(keychain): bound browser cookie prompts per refresh (#4464)”; “fix(lithosai): restore cookie retries and menu bar balance (#4240)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/BrowserCookieAccessGate.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift:279— Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is KimiWebEnrichmentTokenResolver.resolveCredential at line 279), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kimi): reconcile contradictory usage windows (#4311)”; “fix(providers): clarify Kimi and z.ai quota availability (#4091)”; “fix(providers): recover Command Code grants and Kimi web sessions (#3941)”; “fix(kimi): allow saved web accounts through the Linux CLI gate”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCLI/CLIRenderer.swift Sources/CodexBarCLI/CLIRenderer.swift:591— Sources/CodexBarCLI/CLIRenderer.swift changed 13 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is CLIRenderer.liveHistoryLine at line 591), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mistral): show the Monthly Plan in CLI text output”; “fix(cli): show provider history without truncating cards (#3737)”; “fix(credits): preserve pool percentages and reset labels (#3636)”; “fix(abacus): retain credit details beside billing resets (#3637)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCLI/CLIRenderer.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/ProviderFetchPlan.swift Sources/CodexBarCore/Providers/ProviderFetchPlan.swift:396— Sources/CodexBarCore/Providers/ProviderFetchPlan.swift changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is ProviderFetchPipeline.fetch at line 396), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(security): redact fetcher environments and scrub test environments (#4097)”; “fix(antigravity): explain offline fallback and source status (#3865)”; “fix(antigravity): report per-source failures accurately (#3683)”; “fix(providers): honor resolved terminal fetch errors”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/ProviderFetchPlan.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/UsageFormatter.swift Sources/CodexBarCore/UsageFormatter.swift:118— Sources/CodexBarCore/UsageFormatter.swift changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is UsageFormatter.countdownDescription at line 118), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(plugins): report an unset plugin endpoint as needing configuration (#4727)”; “fix(kimi): show gift credit balances with their expiry (#4691)”; “fix(l10n): correct Ukrainian strings and localize countdown units (#4676)”; “fix(providers): handle oversized counts and reset dates (#3764)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/UsageFormatter.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Kimi/KimiUsageSnapshot.swift Sources/CodexBarCore/Providers/Kimi/KimiUsageSnapshot.swift:196— Sources/CodexBarCore/Providers/Kimi/KimiUsageSnapshot.swift changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is KimiUsageSnapshot.giftDetails at line 196), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kimi): show gift credit balances with their expiry (#4691)”; “fix(kimi): reconcile contradictory usage windows (#4311)”; “fix(providers): clarify Kimi and z.ai quota availability (#4091)”; “fix(kimi): reconcile zero ratio placeholders with matching counts (#3755)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Kimi/KimiUsageSnapshot.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBar/Providers/Claude/StatusItemController+ClaudeSwapMenu.swift Sources/CodexBar/Providers/Claude/StatusItemController+ClaudeSwapMenu.swift:107— Sources/CodexBar/Providers/Claude/StatusItemController+ClaudeSwapMenu.swift changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is StatusItemController.startClaudeSwapAccountSwitch at line 107), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(claude): show session forecasts on claude-swap cards (#4566)”; “fix(claude): clarify account switching and await reconciliation (#3740)”; “fix(claude): distinguish accounts in privacy mode (#3495)”; “fix(claude): preserve historical account usage and explicit repair (#3452)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/Providers/Claude/StatusItemController+ClaudeSwapMenu.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountProjection.swift Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountProjection.swift:334— Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountProjection.swift changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is ClaudeSwapAccountProjection.errorText at line 334), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(claude): show session forecasts on claude-swap cards (#4566)”; “fix(claude): honor read-only account adapters (#3846)”; “fix(claude): preserve historical account usage and explicit repair (#3452)”; “fix(claude): preserve claude-swap measurement timestamps”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountProjection.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Plugins/UserProviderPlugins.swift Sources/CodexBarCore/Plugins/UserProviderPlugins.swift:20— Sources/CodexBarCore/Plugins/UserProviderPlugins.swift changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is ProviderPluginApprovalBinding.init at line 20), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(plugins): prune superseded TypeScript output”; “fix(plugins): keep one HTTP session for user plugins”; “fix(plugins): report an unset plugin endpoint as needing configuration (#4727)”; “fix(plugins): release user-plugin network sessions after each request (#4584)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Plugins/UserProviderPlugins.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Mistral/MistralProviderDescriptor.swift Sources/CodexBarCore/Providers/Mistral/MistralProviderDescriptor.swift:13— Sources/CodexBarCore/Providers/Mistral/MistralProviderDescriptor.swift changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is MistralProviderDescriptor.makeDescriptor at line 13), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(charts): preserve zero-usage calendar days for every provider (#4689)”; “fix(widget): align frozen widget colors with menu accents”; “fix(mistral): keep widget selection provider-owned”; “fix(mistral): verify manual cookie gating across platforms”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Mistral/MistralProviderDescriptor.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift:223— Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is MistralUsageFetcher.parseResponse at line 223), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mistral): recover expired redirected sessions”; “fix(mistral): verify billing price dimensions and share aggregation”; “fix(mistral): price billing usage by event type, zone, and tier”; “fix(usage): retain partial history and plan-covered tokens (#3963)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalScan.swift Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalScan.swift:132— Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalScan.swift changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is AntigravityLocalReader.discover at line 132), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(antigravity): scan larger local histories (#4639)”; “fix(security): redact remaining stored process environments (#4106)”; “fix(usage): retain partial history and plan-covered tokens (#3963)”; “fix(antigravity): skip foreign databases without inventing empty history”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalScan.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:37— Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is OllamaUsageFetcher.swift.normalizedOllamaTokenAccountHeader at line 37), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ollama): simplify free usage parsing and regression coverage”; “fix(ollama): parse the Free usage meter on free-plan settings pages”; “fix(ollama): explain empty manual cookie setup”; “fix: retain provider data across transient transport failures (#3672)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Resources/Plugins/muse.js Sources/CodexBarCore/Resources/Plugins/muse.js:8— Sources/CodexBarCore/Resources/Plugins/muse.js changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is muse._optionalChain at line 8), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(muse): try email-matched sessions before blank-email membership checks”; “fix(muse): keep searching after an unbound session's team list fails”; “fix(muse): match blank dev.meta.ai session emails through team membership”; “fix(muse): harden explicit browser team quotas”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Resources/Plugins/muse.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:392— Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is CursorUsageEventsFetcher.fetchAllEvents at line 392), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cursor): harden all-history request regression coverage”; “Fix Cursor all-history cost refresh dates”; “fix(cursor): back off forbidden cost refreshes for six hours (#3924)”; “fix(cursor): handle empty cost history responses”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBar/Providers/Claude/ClaudeSwapAccountMenuDisplay.swift Sources/CodexBar/Providers/Claude/ClaudeSwapAccountMenuDisplay.swift:73— Sources/CodexBar/Providers/Claude/ClaudeSwapAccountMenuDisplay.swift changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ClaudeSwapAccountMenuDisplay.actionLabel at line 73), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(menu): dim retained usage after a failed refresh”; “fix(claude): show session forecasts on claude-swap cards (#4566)”; “fix(claude): clarify account switching and await reconciliation (#3740)”; “fix(claude): distinguish accounts in privacy mode (#3495)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/Providers/Claude/ClaudeSwapAccountMenuDisplay.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift:249— Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is CursorAppAuthStore.loadSession at line 249), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cursor): find the Safe Storage key under its Electron account name”; “fix(cursor): read encrypted Cursor app tokens (#4790)”; “fix(cursor): complete Linux agent login fallback”; “fix(linux): restore Cursor app authentication”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Kimi/KimiModels.swift Sources/CodexBarCore/Providers/Kimi/KimiModels.swift:41— Sources/CodexBarCore/Providers/Kimi/KimiModels.swift changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is KimiCodeAPIUsageResponse.planName at line 41), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kimi): keep web usage when a lapsed plan has no Code pools (#4700)”; “fix(kimi): show gift credit balances with their expiry (#4691)”; “fix(providers): avoid crashes on oversized usage values (#3758)”; “fix(kimi): decode Code API ratio quota pools (#3697)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Kimi/KimiModels.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Kimi/KimiUsageFetcher.swift Sources/CodexBarCore/Providers/Kimi/KimiUsageFetcher.swift:30— Sources/CodexBarCore/Providers/Kimi/KimiUsageFetcher.swift changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is KimiUsageFetcher.fetchCodeAPIUsage at line 30), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kimi): keep web usage when a lapsed plan has no Code pools (#4700)”; “fix(kimi): show gift credit balances with their expiry (#4691)”; “fix(kimi): support regional usage and dashboard hosts (#3826)”; “fix(kimi): decode Code API ratio quota pools (#3697)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Kimi/KimiUsageFetcher.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountList.swift Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountList.swift:169— Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountList.swift changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is ClaudeSwapListParser.parse at line 169), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(claude): show session forecasts on claude-swap cards (#4566)”; “fix(claude): honor read-only account adapters (#3846)”; “fix(claude): preserve historical account usage and explicit repair (#3452)”; “fix(claude): preserve claude-swap measurement timestamps”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountList.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/CodexBar/PredictivePaceWarnings.swift Sources/CodexBar/PredictivePaceWarnings.swift:215— Sources/CodexBar/PredictivePaceWarnings.swift changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is UsageStore.warningClaudeAccountDiscriminators at line 215), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(l10n): correct Ukrainian strings and localize countdown units (#4676)”; “fix(claude): preserve quota warnings across identity gaps”; “fix(claude): keep warnings for unresolved accounts (#3813)”; “fix(claude): preserve verified quota warning history (#3813)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:21:47 -08:00' --until='2026-11-14 00:21:47 -08:00' --full-history --no-merges -- Sources/CodexBar/PredictivePaceWarnings.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
ClassTooLong: ClaudeOAuthCredentialsStore Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:14— ClassTooLong — 2315 significant lines (blank, comment-only and punctuation-only lines excluded), 146 methods. The bar is 400 significant lines; this is 1915 over it, 5.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: CostUsageFetcher Sources/CodexBarCore/CostUsageFetcher.swift:31— ClassTooLong — 1611 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 400 significant lines; this is 1211 over it, 4.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: SpendDashboardModel Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:22— ClassTooLong — 1244 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods. The bar is 400 significant lines; this is 844 over it, 3.11× 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: PiSessionCostScanner Sources/CodexBarCore/PiSessionCostScanner.swift:20— ClassTooLong — 993 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 593 over it, 2.48× 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: IconRenderer Sources/CodexBar/IconRenderer.swift:5— ClassTooLong — 885 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 485 over it, 2.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PiFamilySessionScanner Sources/CodexBarCore/PiFamilySessionScanner.swift:156— ClassTooLong — 879 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 479 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AlibabaTokenPlanUsageFetcher Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:35— ClassTooLong — 833 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 433 over it, 2.08× 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: CostHistoryChartMenuView Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:6— ClassTooLong — 825 significant lines (blank, comment-only and punctuation-only lines excluded), 66 methods. The bar is 400 significant lines; this is 425 over it, 2.06× 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: CLIRenderer Sources/CodexBarCLI/CLIRenderer.swift:5— ClassTooLong — 807 significant lines (blank, comment-only and punctuation-only lines excluded), 75 methods. The bar is 400 significant lines; this is 407 over it, 2.02× 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: CodexWorkspaceUsageSidecar Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:13— ClassTooLong — 805 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 405 over it, 2.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MenuBarLayoutRenderer Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:309— ClassTooLong — 803 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 403 over it, 2.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OpenAIDashboardBrowserCookieImporter Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:7— ClassTooLong — 746 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 346 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: UsageStore Sources/CodexBar/UsageStore/UsageStore.swift:121— ClassTooLong — 704 significant lines (blank, comment-only and punctuation-only lines excluded), 836 methods. The bar is 400 significant lines; this is 304 over it, 1.76× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StatusItemController Sources/CodexBar/StatusItem/StatusItemController.swift:41— ClassTooLong — 684 significant lines (blank, comment-only and punctuation-only lines excluded), 603 methods. The bar is 400 significant lines; this is 284 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: SpendDashboardSource Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:166— ClassTooLong — 663 significant lines (blank, comment-only and punctuation-only lines excluded), 40 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: SpendDashboardController Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:1086— ClassTooLong — 659 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 259 over it, 1.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: KiloUsageFetcher Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:200— ClassTooLong — 653 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods. The bar is 400 significant lines; this is 253 over it, 1.63× 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: OpenAIDashboardFetcher Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:6— ClassTooLong — 652 significant lines (blank, comment-only and punctuation-only lines excluded), 72 methods, 2 blocks, lines 7-1292. The bar is 400 significant lines; this is 252 over it, 1.63× 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: ProviderSwitcherView Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:10— ClassTooLong — 652 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods. The bar is 400 significant lines; this is 252 over it, 1.63× 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: CloudSyncEngine Sources/CodexBar/Sync/CloudSyncEngine.swift:458— ClassTooLong — 646 significant lines (blank, comment-only and punctuation-only lines excluded), 59 methods. The bar is 400 significant lines; this is 246 over it, 1.62× 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: FactoryStatusProbe Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:588— ClassTooLong — 638 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 238 over it, 1.60× 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: KiroStatusProbe Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:302— ClassTooLong — 635 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 235 over it, 1.59× 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: AntigravityStatusProbe Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:831— ClassTooLong — 621 significant lines (blank, comment-only and punctuation-only lines excluded), 67 methods. The bar is 400 significant lines; this is 221 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: CookieHeaderCache Sources/CodexBarCore/CookieHeaderCache.swift:60— ClassTooLong — 617 significant lines (blank, comment-only and punctuation-only lines excluded), 80 methods. The bar is 400 significant lines; this is 217 over it, 1.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: QuickJSProviderPluginEngine Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:197— ClassTooLong — 616 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 216 over it, 1.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.
Duplicated block (5 lines × 2) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:707— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:707-711 | Sources/CodexBarCore/PiSessionCostScanner.swift:1354-1358 — 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:907— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:907-911 | Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:969-973 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (5 lines × 2) Sources/CodexBar/Menu/MenuBarLayout.swift:1179— Sources/CodexBar/Menu/MenuBarLayout.swift:1179-1183 | Sources/CodexBar/Menu/MenuBarLayout.swift:1344-1348 — 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) Sources/CodexBar/Providers/Codex/CodexAccountUsageSnapshotStore.swift:165— Sources/CodexBar/Providers/Codex/CodexAccountUsageSnapshotStore.swift:165-169 | Sources/CodexBarCore/Providers/Codex/CodexOpenAIWorkspaceIdentityCache.swift:61-65 — 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 `Sources/CodexBar/Providers/Codex/CodexAccountUsageSnapshotStore.swift:165` 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) Sources/CodexBar/Providers/Codex/PreferencesCodexAccountsSection.swift:139— Sources/CodexBar/Providers/Codex/PreferencesCodexAccountsSection.swift:139-143 | Sources/CodexBar/Providers/Codex/PreferencesCodexAccountsSection.swift:169-173 — 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 `Sources/CodexBar/Providers/Codex/PreferencesCodexAccountsSection.swift:139` 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) Sources/CodexBar/SessionUsageBrowser.swift:240— Sources/CodexBar/SessionUsageBrowser.swift:240-244 | Sources/CodexBar/SessionUsageBrowser.swift:342-346 — 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 `Sources/CodexBar/SessionUsageBrowser.swift:240` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/CodexBar/SpendDashboard/SpendActivityHeatmap.swift:524— Sources/CodexBar/SpendDashboard/SpendActivityHeatmap.swift:524-531 | Sources/CodexBar/SpendDashboard/SpendActivityHeatmap.swift:796-800 — 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 `Sources/CodexBar/SpendDashboard/SpendActivityHeatmap.swift:524` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:92— Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:92-96 | Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:890-897 — 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 `Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:366— Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:366-370 | Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:385-392 — 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 `Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:366` 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) Sources/CodexBarCore/CookieHeaderCache.swift:308— Sources/CodexBarCore/CookieHeaderCache.swift:308-312 | Sources/CodexBarCore/CookieHeaderCache.swift:967-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. 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (5 lines × 2) Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:212— Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:212-216 | Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:1146-1150 — 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 (5 lines × 2) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1072— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1072-1076 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1082-1086 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalReader.swift:151— Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalReader.swift:151-155 | Sources/CodexBarCore/Providers/Muse/MuseLocalUsageReader.swift:186-190 — 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 `Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalReader.swift:151` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) Sources/CodexBarCore/Providers/Augment/AugmentSessionKeepalive.swift:491— Sources/CodexBarCore/Providers/Augment/AugmentSessionKeepalive.swift:491-495 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot.swift:253-257 — 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 `Sources/CodexBarCore/Providers/Augment/AugmentSessionKeepalive.swift:491` 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 (5 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift:342— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift:342-346 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift:356-360 — 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (5 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:601— Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:601-605 | Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:664-668 — 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) Sources/CodexBarCore/Providers/Factory/FactoryLocalStorageImporter.swift:19— Sources/CodexBarCore/Providers/Factory/FactoryLocalStorageImporter.swift:19-23 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:15-19 — 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 `Sources/CodexBarCore/Providers/Factory/FactoryLocalStorageImporter.swift:19` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:56— Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:56-60 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieHeaders.swift:108-112 — before extracting anything, compare `Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift` and `Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieHeaders.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:56` 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 (5 lines × 2) Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift:335— Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift:335-339 | Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift:355-359 — 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 `Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift:335` 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) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:769— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:769-773 | Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1320-1324 — 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 (5 lines × 2) Sources/CodexBar/Settings/PreferencesDebugPane.swift:507— Sources/CodexBar/Settings/PreferencesDebugPane.swift:507-511 | Sources/CodexBar/Settings/PreferencesProvidersPane.swift:653-657 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift:30— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift:30-34 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxAPISettingsReader.swift:17-21 — 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 (5 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift:36— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift:36-42 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxSettingsReader.swift:39-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:294— Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:294-298 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:645-649 — 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 (5 lines × 2) Sources/CodexBarCore/Providers/Groq/GroqConsoleFetcher.swift:283— Sources/CodexBarCore/Providers/Groq/GroqConsoleFetcher.swift:283-287 | Sources/CodexBarCore/Providers/Groq/GroqUsageFetcher.swift:226-230 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
+ 15 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file Sources/CodexBarCore/Resources/Plugins/chutes.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/openrouter.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/openai.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/chutes.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/bifrost.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/zai.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/bifrost.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/workbuddy.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/zoommate.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/workbuddy.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/litellm.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/huggingface.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/muse.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/notion.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/aixy.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/muse.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/zoommate.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/huggingface.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/litellm.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/aixy.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/claudeplatform.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/claudeplatform.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/CodexBarCore/Resources/Plugins/longcat.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
Duplicated block (9 lines × 2) Sources/CodexBar/Menu/MenuBarLayout.swift:1321— Sources/CodexBar/Menu/MenuBarLayout.swift:1321-1329 | Sources/CodexBar/Menu/MenuBarLayout.swift:1527-1535 — 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 `Sources/CodexBar/Menu/MenuBarLayout.swift:1321` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:44— Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:44-52 | Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:168-176 — 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) Sources/CodexBar/Menu/UsageProgressBar.swift:250— Sources/CodexBar/Menu/UsageProgressBar.swift:250-258 | Sources/CodexBar/Menu/UsageProgressBar.swift:262-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) Sources/CodexBar/Settings/PreferencesDebugPane.swift:221— Sources/CodexBar/Settings/PreferencesDebugPane.swift:221-229 | Sources/CodexBar/Settings/PreferencesDebugPane.swift:410-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/Settings/PreferencesDebugPane.swift:221` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:1134— Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:1134-1142 | Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:1160-1168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:1133` calls `invalidateCacheIfCredentialsFileChanged` and `Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:1159` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) Sources/CodexBarCLI/CLIConfigClearCredentialCommand.swift:13— Sources/CodexBarCLI/CLIConfigClearCredentialCommand.swift:13-21 | Sources/CodexBarCLI/CLIHooksCommand.swift:89-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) Sources/CodexBarCLI/CLIConfigLoginCommand.swift:114— Sources/CodexBarCLI/CLIConfigLoginCommand.swift:114-122 | Sources/CodexBarCLI/CLIConfigLoginCommand.swift:177-185 — 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 `Sources/CodexBarCLI/CLIConfigLoginCommand.swift:114` 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) Sources/CodexBarCore/CodexThreadCatalogReader.swift:93— Sources/CodexBarCore/CodexThreadCatalogReader.swift:93-101 | Sources/CodexBarCore/CodexThreadCatalogReader.swift:109-117 — 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 `Sources/CodexBarCore/CodexThreadCatalogReader.swift:93` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:599— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:599-607 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:626-634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1146— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1146-1154 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1162-1170 — 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 `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1146` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift:44— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift:44-52 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxSettingsReader.swift:45-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.
Duplicated block (9 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:756— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:756-764 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1100-1108 — 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 `Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:756` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:242— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:242-250 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:168-176 — 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 `Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:242` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:37— Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:37-45 | Sources/CodexBarCore/Providers/Zai/ZaiProviderDescriptor.swift:87-96 — 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 `Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:37` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:71— Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:71-79 | Sources/CodexBarCore/Providers/OpenCode/OpenCodeCookieImporter.swift:37-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:260— Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:260-268 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:670-678 — 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 `Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:260` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:394— Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:394-402 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:724-732 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:394` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:272— Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:272-280 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:616-624 — 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 (9 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:142— Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:142-150 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift:152-160 — before extracting anything, compare `Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift` and `Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:142` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:9— Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:9-20 | Sources/CodexBarCore/Providers/Grok/GrokCredentialRouting.swift:8-16 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:7` calls `adminAPIKey` and `Sources/CodexBarCore/Providers/Grok/GrokCredentialRouting.swift:6` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:56— Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:56-64 | Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:72-80 — 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 `Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) REDACTED:244— REDACTED:244-252 | REDACTED:265-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:244` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:86— Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:86-94 | Sources/CodexBarCore/Providers/HuggingFace/HuggingFaceProviderDescriptor.swift:77-85 — 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 `Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:669— Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:669-677 | Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:679-687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:756— Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:756-764 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:882-891 — 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 `Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:756` 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.
+ 14 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×37
Edited copy of a member (11 corresponding lines) Sources/CodexBarCore/ProviderDetailSection.swift:118— Sources/CodexBarCore/ProviderDetailSection.swift:118-128 | Sources/CodexBarCore/WidgetSnapshot.swift:147-158 — 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) Sources/CodexBarCore/DarwinProcessEnumerator.swift:84— Sources/CodexBarCore/DarwinProcessEnumerator.swift:84-94 | Sources/CodexBarCore/DarwinProcessEnumerator.swift:189-207 — 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) Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:656— Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:656-666 | Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:690-700 — 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) Sources/AdaptiveReplayKit/AgentAwarePolicies.swift:12— Sources/AdaptiveReplayKit/AgentAwarePolicies.swift:12-22 | Sources/AdaptiveReplayKit/BaselinePolicies.swift:15-25 — 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) Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:214— Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:214-224 | Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:231-241 — 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) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanAPIRegion.swift:64— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanAPIRegion.swift:64-76 | Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanAPIRegion.swift:87-97 — 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) Sources/CodexBar/Providers/Codex/UsageStore+CodexCostCatchUp.swift:303— Sources/CodexBar/Providers/Codex/UsageStore+CodexCostCatchUp.swift:303-313 | Sources/CodexBar/Providers/Codex/UsageStore+SpendDashboardCodexCostCatchUp.swift:250-261 — 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) Sources/CodexBarWidget/CodexBarWidgetProvider.swift:170— Sources/CodexBarWidget/CodexBarWidgetProvider.swift:170-180 | Sources/CodexBarWidget/CodexBarWidgetProvider.swift:254-268 — 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) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1643— Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1643-1654 | Sources/CodexBar/StatusItem/StatusItemController+UsageHistoryMenu.swift:23-33 — 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) Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:1100— Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:1100-1115 | Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:1137-1147 — 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) Sources/CodexBar/UsageStore/UsageStore+SpendDashboardPublication.swift:68— Sources/CodexBar/UsageStore/UsageStore+SpendDashboardPublication.swift:68-78 | Sources/CodexBar/UsageStore/UsageStore+SpendDashboardPublication.swift:95-107 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/CodexBarCore/KeychainAccessPreflight.swift:159— Sources/CodexBarCore/KeychainAccessPreflight.swift:159-169 | Sources/CodexBarCore/KeychainAccessPreflight.swift:171-182 — 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) Sources/CodexBarCore/Providers/Grok/GrokProviderDescriptor.swift:746— Sources/CodexBarCore/Providers/Grok/GrokProviderDescriptor.swift:746-756 | Sources/CodexBarCore/Providers/Grok/GrokStatusProbe.swift:297-307 — 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) Sources/CodexBar/Providers/Codex/CodexAccountUsageSnapshotStore.swift:220— Sources/CodexBar/Providers/Codex/CodexAccountUsageSnapshotStore.swift:220-230 | Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:438-451 — 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) Sources/CodexBar/UsagePaceText.swift:98— Sources/CodexBar/UsagePaceText.swift:98-111 | Sources/CodexBarCLI/CLIRenderer.swift:986-996 — 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) Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:150— Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:150-160 | Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:163-173 — 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) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:318— Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:318-328 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:382-401 — 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) Sources/CodexBar/Providers/Antigravity/AntigravitySettingsStore.swift:32— Sources/CodexBar/Providers/Antigravity/AntigravitySettingsStore.swift:32-42 | Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:166-177 — 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) Sources/CodexBar/SpendDashboard/SpendDashboardSummary.swift:111— Sources/CodexBar/SpendDashboard/SpendDashboardSummary.swift:111-123 | Sources/CodexBar/SpendDashboard/SpendDashboardSummary.swift:130-140 — 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) Sources/CodexBar/Providers/LongCat/LongCatSettingsStore.swift:7— Sources/CodexBar/Providers/LongCat/LongCatSettingsStore.swift:7-17 | Sources/CodexBar/Providers/Windsurf/WindsurfSettingsStore.swift:10-20 — 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) Sources/CodexBarCore/Providers/Aixy/AixySettingsReader.swift:14— Sources/CodexBarCore/Providers/Aixy/AixySettingsReader.swift:14-25 | Sources/CodexBarCore/Providers/Sub2API/Sub2APISettingsReader.swift:25-35 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials+TestingOverrides.swift:182— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials+TestingOverrides.swift:182-192 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials+TestingOverrides.swift:194-204 — 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) Sources/CodexBarCore/Providers/CommandCode/CommandCodeUsageFetcher.swift:50— Sources/CodexBarCore/Providers/CommandCode/CommandCodeUsageFetcher.swift:50-60 | Sources/CodexBarCore/Providers/CommandCode/CommandCodeUsageFetcher.swift:62-72 — 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) Sources/CodexBar/Providers/Codex/CodexWorkspacesInspectorModel.swift:235— Sources/CodexBar/Providers/Codex/CodexWorkspacesInspectorModel.swift:235-249 | Sources/CodexBar/Providers/Codex/CodexWorkspacesInspectorModel.swift:251-261 — 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) Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:196— Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:196-206 | Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:208-220 — 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.
TooManyMethods: UsageStore Sources/CodexBar/UsageStore/UsageStore.swift:121— TooManyMethods — 836 methods, declared across 86 files: Codex/UsageStore+OpenAIWeb.swift (62), UsageStore/UsageStore+PlanUtilization.swift (62), UsageStore/UsageStore+TokenAccounts.swift (53), UsageStore/UsageStore+TokenCost.swift (51), +82 more file(s). The bar is 30 methods; this is 806 over it, 27.87× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: StatusItemController Sources/CodexBar/StatusItem/StatusItemController.swift:41— TooManyMethods — 603 methods, declared across 65 files: StatusItem/StatusItemController+Actions.swift (68), StatusItem/StatusItemController+Animation.swift (62), StatusItem/StatusItemController+Menu.swift (53), StatusItem/StatusItemController+MenuTracking.swift (45), +61 more file(s). The bar is 30 methods; this is 573 over it, 20.10× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: SettingsStore Sources/CodexBar/Settings/SettingsStore.swift:244— TooManyMethods — 250 methods, declared across 37 files: Settings/SettingsStore.swift (48), Settings/SettingsStore+Defaults.swift (28), Settings/SettingsStore+Config.swift (27), Codex/CodexSettingsStore.swift (26), +33 more file(s). The bar is 30 methods; this is 220 over it, 8.33× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Model Sources/CodexBarCore/ProviderThroughputSnapshot.swift:12— TooManyMethods — 158 methods, declared across 14 files: Menu/MenuCardView+ModelHelpers.swift (63), Menu/InlineUsageDashboardContent.swift (28), Menu/MenuCardView+Costs.swift (25), Menu/MenuCardView.swift (17), +10 more file(s). The bar is 30 methods; this is 128 over it, 5.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: OpenAIDashboardFetcher Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:6— TooManyMethods — 72 methods, declared across 4 files: OpenAIWeb/OpenAIDashboardFetcher.swift (55), OpenAIWeb/OpenAIDashboardFetcher+ReturnableData.swift (9), OpenAIWeb/OpenAIDashboardFetcher+PageScrape.swift (5), OpenAIWeb/OpenAIDashboardFetcher+SessionAuthorization.swift (3). The bar is 30 methods; this is 42 over it, 2.40× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: ClaudeStatusProbe Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:76— TooManyMethods — 72 methods. The bar is 30 methods; this is 42 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ProviderSwitcherView Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:10— TooManyMethods — 68 methods, declared across 2 files: StatusItem/StatusItemController+SwitcherViews.swift (67), StatusItem/StatusItemController+UserPlugins.swift (1). The bar is 30 methods; this is 38 over it, 2.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: AntigravityStatusProbe Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:831— TooManyMethods — 67 methods, declared across 6 files: Antigravity/AntigravityStatusProbe.swift (49), Antigravity/AntigravityQuotaSummaryParser.swift (6), Antigravity/AntigravityStatusProbe+PortDetection.swift (6), Antigravity/AntigravityStatusProbe+Deadline.swift (3), +2 more file(s). The bar is 30 methods; this is 37 over it, 2.23× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: CostHistoryChartMenuView Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:6— TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CloudSyncEngine Sources/CodexBar/Sync/CloudSyncEngine.swift:458— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× 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: SpendDashboardModel Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:22— TooManyMethods — 57 methods, declared across 2 files: SpendDashboard/SpendDashboardModel.swift (47), SpendDashboard/SpendDashboardModel+ModelBreakdown.swift (10). The bar is 30 methods; this is 27 over it, 1.90× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: CostUsageFetcher Sources/CodexBarCore/CostUsageFetcher.swift:31— TooManyMethods — 55 methods, declared across 5 files: CodexBarCore/CostUsageFetcher.swift (50), CodexBarCore/CostUsageFetcher+Projectless.swift (2), Antigravity/AntigravityLocalScan.swift (1), Muse/CostUsageFetcher+Muse.swift (1), +1 more file(s). The bar is 30 methods; this is 25 over it, 1.83× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: MenuBarLayoutRenderer Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:309— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× 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: ProvidersPane Sources/CodexBar/Settings/PreferencesProvidersPane.swift:16— TooManyMethods — 48 methods, declared across 2 files: Settings/PreferencesProvidersPane.swift (34), Settings/PreferencesProvidersPane+Testing.swift (14). The bar is 30 methods; this is 18 over it, 1.60× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: AlibabaTokenPlanUsageFetcher Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:35— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× 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: ProviderSettingsSnapshot Sources/CodexBarCore/Providers/ProviderSettingsSnapshot.swift:10— TooManyMethods — 46 methods, declared across 41 files: Providers/ProviderSettingsSnapshot.swift (5), Alibaba/AlibabaProviderSettings.swift (2), Abacus/AbacusProviderSettings.swift (1), Amp/AmpProviderSettings.swift (1), +37 more file(s). The bar is 30 methods; this is 16 over it, 1.53× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: SpawnedProcessGroup Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:19— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GeminiStatusProbe Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:177— TooManyMethods — 43 methods, declared across 2 files: Gemini/GeminiStatusProbe.swift (36), Gemini/GeminiStatusProbe+DataLoader.swift (7). The bar is 30 methods; this is 13 over it, 1.43× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: ClaudeUsageFetcher Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:108— TooManyMethods — 42 methods, declared across 2 files: Claude/ClaudeUsageFetcher.swift (39), Claude/ClaudeUsageFetcher+DelegatedRefreshMessages.swift (3). The bar is 30 methods; this is 12 over it, 1.40× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: KiloUsageFetcher Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:200— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ProviderSettingsSnapshotContribution Sources/CodexBarCore/Providers/ProviderSettingsSnapshot.swift:62— TooManyMethods — 42 methods, declared across 40 files: Alibaba/AlibabaProviderSettings.swift (2), Providers/ProviderSettingsSnapshot.swift (2), Abacus/AbacusProviderSettings.swift (1), Amp/AmpProviderSettings.swift (1), +36 more file(s). The bar is 30 methods; this is 12 over it, 1.40× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: PlanUtilizationHistoryChartMenuView Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:5— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: KiroStatusProbe Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:302— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: QuickJSProviderPluginEngine Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:197— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AlibabaCodingPlanUsageFetcher Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:6— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
+ 11 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×36
Edited copy of a member (7 corresponding lines) Sources/CodexBar/Menu/MenuBarLayout.swift:328— Sources/CodexBar/Menu/MenuBarLayout.swift:328-336 | Sources/CodexBarCore/CreditsModels.swift:28-34 — 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) Sources/CodexBarCore/Providers/Wayfinder/WayfinderSettingsReader.swift:45— Sources/CodexBarCore/Providers/Wayfinder/WayfinderSettingsReader.swift:45-52 | Sources/CodexBarCore/Providers/Wayfinder/WayfinderUsageFetcher.swift:387-393 — 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) Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:1007— Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:1007-1015 | Sources/CodexBarCore/TextParsing.swift:5-11 — 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) Sources/CodexBarCore/Providers/Kimi/KimiModels.swift:184— Sources/CodexBarCore/Providers/Kimi/KimiModels.swift:184-190 | Sources/CodexBarCore/UsageFetcher.swift:959-965 — 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) Sources/CodexBarCore/CreditsModels.swift:36— Sources/CodexBarCore/CreditsModels.swift:36-42 | Sources/CodexBarCore/UsageFetcher.swift:160-168 — 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) Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:102— Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:102-108 | Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:184-193 — 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) Sources/CodexBar/UsagePaceText.swift:45— Sources/CodexBar/UsagePaceText.swift:45-51 | Sources/CodexBar/UsagePaceText.swift:187-193 — 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) Sources/CodexBarCore/Providers/Devin/DevinUsageSnapshot.swift:345— Sources/CodexBarCore/Providers/Devin/DevinUsageSnapshot.swift:345-351 | TestsPlugin/T3ChatReference.swift:50-58 — 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) Sources/CodexBarCore/Providers/Antigravity/AntigravityOfflineStore.swift:88— Sources/CodexBarCore/Providers/Antigravity/AntigravityOfflineStore.swift:88-94 | Sources/CodexBarCore/Providers/Antigravity/AntigravityOfflineStore.swift:96-102 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1730— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1730-1736 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:2095-2101 — 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) Sources/CodexBar/Settings/SettingsStore+ConfigPersistence.swift:37— Sources/CodexBar/Settings/SettingsStore+ConfigPersistence.swift:37-50 | Sources/CodexBar/Settings/SettingsStore.swift:1166-1172 — 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) Sources/CodexBarCLI/CLIHelpers.swift:99— Sources/CodexBarCLI/CLIHelpers.swift:99-105 | TestsPlugin/ManusReference.swift:141-152 — 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) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekProviderDescriptor.swift:367— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekProviderDescriptor.swift:367-373 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxProviderDescriptor.swift:171-180 — 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) Sources/CodexBarCLI/CLIGuardCommand.swift:183— Sources/CodexBarCLI/CLIGuardCommand.swift:183-189 | Sources/CodexBarCLI/CLIGuardCommand.swift:191-197 — 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) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1529— Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1529-1537 | Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1539-1545 — 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) Sources/CodexBar/UsageStore/UsageStore+Hooks.swift:284— Sources/CodexBar/UsageStore/UsageStore+Hooks.swift:284-290 | Sources/CodexBar/UsageStore/UsageStore+QuotaWarnings.swift:232-238 — 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) Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:712— Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:712-718 | Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:720-726 — 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) Sources/CodexBarWidget/CodexBarWidgetViews.swift:745— Sources/CodexBarWidget/CodexBarWidgetViews.swift:745-751 | Sources/CodexBarWidget/CodexBarWidgetViews.swift:761-768 — 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) Sources/CodexBar/PlanUtilizationHistoryStore.swift:321— Sources/CodexBar/PlanUtilizationHistoryStore.swift:321-327 | Sources/CodexBarCore/OpenAIDashboardModels.swift:418-428 — 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) Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:252— Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:252-261 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:355-361 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:581— Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:581-590 | Sources/CodexBarCore/Providers/Factory/FactoryManualCredentials.swift:24-30 — 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) Sources/CodexBarCore/Providers/HuggingFace/HuggingFaceSettingsReader.swift:56— Sources/CodexBarCore/Providers/HuggingFace/HuggingFaceSettingsReader.swift:56-62 | Sources/CodexBarCore/PathEnvironment.swift:1108-1116 — 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) Sources/CodexBar/Settings/PreferencesProvidersPane.swift:613— Sources/CodexBar/Settings/PreferencesProvidersPane.swift:613-619 | Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:914-920 — 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) Sources/CodexBarCLI/CLICardsBriefRenderer.swift:207— Sources/CodexBarCLI/CLICardsBriefRenderer.swift:207-213 | Sources/CodexBarCLI/CLICardsRenderer.swift:588-594 — 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) Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:80— Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:80-86 | Sources/CodexBarCore/Providers/Gemini/GeminiProviderDescriptor.swift:115-121 — 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.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/AppGroupSupport.swift:173— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/CodexLaunchPreflight+SignatureIdentity.swift:20— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/CopilotUsageModels.swift:258— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/PathEnvironment.swift:690— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/PiFamilySessionScanner.swift:96— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/PiProcessEnvironment.swift:68— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/PiSessionCostScanner.swift:706— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/PiSessionCostScanner.swift:986— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/WidgetSnapshot.swift:325— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/ProviderVersionDetector.swift:102— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/ProviderVersionDetector.swift:115— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/ProviderVersionDetector.swift:129— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieImporter.swift:159— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/Perplexity/PerplexityCookieImporter.swift:131— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift:311— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoZenBalanceFetcher.swift:52— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/OpenCode/OpenCodeCookieImporter.swift:80— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/Nous/NousProviderDescriptor.swift:62— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/Mistral/MistralCookieImporter.swift:106— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/Kimi/KimiCookieImporter.swift:135— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/Kimi/KimiDesktopAuthToken.swift:48— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/Kimi/KimiDesktopAuthToken.swift:51— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/Kimi/KimiModels.swift:27— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/Grok/GrokCLISettingsFetcher.swift:41— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:105— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Duplicated block (6 lines × 2) Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:37— Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:37-42 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:71-76 — before extracting anything, compare `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift` and `Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 172 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 `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:292— Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:292-297 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:422-429 — before extracting anything, compare `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift` and `Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 172 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 (6 lines × 2) Sources/CodexBar/Providers/Codex/CodexAccountSwitcherView.swift:51— Sources/CodexBar/Providers/Codex/CodexAccountSwitcherView.swift:51-56 | Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:1204-1209 — 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 `Sources/CodexBar/Providers/Codex/CodexAccountSwitcherView.swift:51` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/CodexBarCLI/CLICostCommand.swift:101— Sources/CodexBarCLI/CLICostCommand.swift:101-106 | Sources/CodexBarCLI/CLICostCommand.swift:145-150 — 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 (6 lines × 2) Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:521— Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:521-526 | Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:566-571 — 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (6 lines × 2) Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:577— Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:577-582 | Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:623-628 — 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 `Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:577` 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) Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:760— Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:760-765 | Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:771-776 — 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 `Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:760` 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) Sources/CodexBarCore/Providers/Antigravity/AntigravityOfflineStore.swift:89— Sources/CodexBarCore/Providers/Antigravity/AntigravityOfflineStore.swift:89-94 | Sources/CodexBarCore/Providers/Antigravity/AntigravityOfflineStore.swift:97-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) Sources/CodexBarCore/Providers/Codex/CodexStatusProbe.swift:188— Sources/CodexBarCore/Providers/Codex/CodexStatusProbe.swift:188-193 | Sources/CodexBarCore/Providers/Codex/CodexStatusProbe.swift:196-201 — 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 `Sources/CodexBarCore/Providers/Codex/CodexStatusProbe.swift:188` 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) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:781— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:781-786 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxBillingHistory.swift:324-329 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:328— Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:328-333 | Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:340-345 — 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 `Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:328` 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, `Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:348` calls `response`, `statusError` and `Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:335` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:405— Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:405-410 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:830-835 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleSECTokenResolver.swift:110— Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleSECTokenResolver.swift:110-115 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleSECTokenResolver.swift:204-209 — 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 (6 lines × 2) Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:689— Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:689-694 | Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:719-724 — 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 (6 lines × 2) Sources/CodexBar/Providers/Claude/ClaudeSwapAccountSwitcherView.swift:63— Sources/CodexBar/Providers/Claude/ClaudeSwapAccountSwitcherView.swift:63-68 | Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:1272-1277 — 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 `Sources/CodexBar/Providers/Claude/ClaudeSwapAccountSwitcherView.swift: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.
Duplicated block (6 lines × 2) Sources/CodexBar/Settings/PreferencesDebugPane.swift:569— Sources/CodexBar/Settings/PreferencesDebugPane.swift:569-574 | Sources/CodexBarCLI/CLIHelpers.swift:111-116 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:209— Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:209-214 | Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1643-1648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:600— Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:600-605 | Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:886-891 — 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 (6 lines × 2) Sources/CodexBarCore/CodexManagedAccounts.swift:48— Sources/CodexBarCore/CodexManagedAccounts.swift:48-53 | Sources/CodexBarCore/Providers/Codex/CodexOpenAIWorkspaceResolver.swift:19-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/CodexBarCore/CodexManagedAccounts.swift:55— Sources/CodexBarCore/CodexManagedAccounts.swift:55-60 | Sources/CodexBarCore/Providers/Codex/CodexOpenAIWorkspaceResolver.swift:98-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/CodexBarCore/PiSessionCostCache.swift:14— Sources/CodexBarCore/PiSessionCostCache.swift:14-19 | Sources/CodexBarCore/Providers/Muse/MuseLocalUsageCache.swift:136-141 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:315— Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:315-320 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:657-663 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/CodexBarCore/Providers/Bedrock/BedrockProfileCredentialProvider.swift:81— Sources/CodexBarCore/Providers/Bedrock/BedrockProfileCredentialProvider.swift:81-86 | Sources/CodexBarCore/Providers/IBMBob/IBMBobUsageFetcher.swift:352-357 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:32— Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:32-37 | Sources/CodexBarCore/Providers/Perplexity/PerplexityCookieImporter.swift:67-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:1347— Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:1347-1352 | Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:496-501 — 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.
+ 8 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×31
Edited copy of a member (8 corresponding lines) Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:1157— Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:1157-1164 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:1209-1219 — 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) Sources/CodexBar/Providers/Codex/CodexLoginAlertPresentation.swift:36— Sources/CodexBar/Providers/Codex/CodexLoginAlertPresentation.swift:36-43 | Sources/CodexBar/Providers/Kiro/KiroLoginAlertPresentation.swift:25-36 — 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) Sources/CodexBarCore/CostUsageModels.swift:1373— Sources/CodexBarCore/CostUsageModels.swift:1373-1380 | Sources/CodexBarCore/CostUsageModels.swift:1394-1401 — 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) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:1936— Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:1936-1943 | Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:1945-1952 — 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) Sources/CodexBar/Settings/PreferencesProvidersPane.swift:199— Sources/CodexBar/Settings/PreferencesProvidersPane.swift:199-206 | Sources/CodexBar/Settings/PreferencesSidebar.swift:186-193 — 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) Sources/CodexBarCore/Plugins/ProviderPluginManifest.swift:390— Sources/CodexBarCore/Plugins/ProviderPluginManifest.swift:390-401 | Sources/CodexBarCore/ProviderDetailSection.swift:251-258 — 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) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1071— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1071-1079 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1081-1088 — 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) Sources/CodexBarCore/Providers/CommandCode/CommandCodeUsageFetcher.swift:231— Sources/CodexBarCore/Providers/CommandCode/CommandCodeUsageFetcher.swift:231-238 | Sources/CodexBarCore/Providers/CommandCode/CommandCodeUsageFetcher.swift:240-247 — 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) Sources/CodexBarCore/Providers/Ollama/OllamaUsageParser.swift:65— Sources/CodexBarCore/Providers/Ollama/OllamaUsageParser.swift:65-82 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageParser.swift:110-117 — 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) Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:647— Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:647-654 | Sources/CodexBarCore/Providers/OpenCode/OpenCodeLocalHistoryAdapter.swift:159-168 — 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) Sources/CodexBar/Providers/Codex/ManagedCodexAccountService.swift:367— Sources/CodexBar/Providers/Codex/ManagedCodexAccountService.swift:367-374 | Sources/CodexBarCore/Providers/Codex/CodexAccountPromotionExecution.swift:317-325 — 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) Sources/CodexBarCore/ISO8601DateParser.swift:4— Sources/CodexBarCore/ISO8601DateParser.swift:4-11 | Sources/CodexBarCore/Providers/Nous/NousSettingsReader.swift:236-243 — 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) Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:56— Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:56-63 | Sources/CodexBarCore/Providers/Venice/VeniceCookieImporter.swift:34-41 — 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) Sources/CodexBar/Providers/Codex/CodexAccountSwitcherView.swift:279— Sources/CodexBar/Providers/Codex/CodexAccountSwitcherView.swift:279-286 | Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:1283-1290 — 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) Sources/CodexBarCore/Providers/MiMo/MiMoUsageFetcher.swift:51— Sources/CodexBarCore/Providers/MiMo/MiMoUsageFetcher.swift:51-58 | Sources/CodexBarCore/Providers/OpenRouter/OpenRouterSettingsReader.swift:26-33 — 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) Sources/CodexBarCore/AgentSession.swift:130— Sources/CodexBarCore/AgentSession.swift:130-137 | Sources/CodexBarCore/AgentSession.swift:139-146 — 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) Sources/CodexBar/Menu/MenuCardCompactAccountRow.swift:145— Sources/CodexBar/Menu/MenuCardCompactAccountRow.swift:145-152 | Sources/CodexBar/Menu/MenuCardCompactAccountRow.swift:154-161 — 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) Sources/CodexBar/Menu/MenuCardView.swift:1100— Sources/CodexBar/Menu/MenuCardView.swift:1100-1110 | Sources/CodexBar/Menu/MenuDescriptor.swift:788-795 — 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) Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:854— Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:854-861 | Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:71-78 — 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) Sources/CodexBarCore/Providers/SiliconFlow/SiliconFlowSettingsReader.swift:36— Sources/CodexBarCore/Providers/SiliconFlow/SiliconFlowSettingsReader.swift:36-43 | Sources/CodexBarCore/Providers/Zai/ZaiSettingsReader.swift:96-103 — 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) Sources/CodexBarCLI/CLIServeCommand.swift:1115— Sources/CodexBarCLI/CLIServeCommand.swift:1115-1125 | Sources/CodexBarCLI/DashboardAccountCollector.swift:64-71 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift:699— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift:699-706 | Sources/CodexBarCore/Providers/Devin/DevinSessionImporter.swift:19-26 — 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) Sources/CodexBarCore/Providers/JetBrains/JetBrainsProviderDescriptor.swift:61— Sources/CodexBarCore/Providers/JetBrains/JetBrainsProviderDescriptor.swift:61-68 | Sources/CodexBarCore/Providers/Windsurf/WindsurfProviderDescriptor.swift:114-121 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:275— Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:275-282 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:719-726 — 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) Sources/CodexBarCore/Providers/SiliconFlow/SiliconFlowSettingsReader.swift:13— Sources/CodexBarCore/Providers/SiliconFlow/SiliconFlowSettingsReader.swift:13-20 | Sources/CodexBarCore/Providers/Wayfinder/WayfinderSettingsReader.swift:19-28 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (8 lines × 2) Sources/CodexBar/Menu/MenuCardView.swift:1284— Sources/CodexBar/Menu/MenuCardView.swift:1284-1291 | Sources/CodexBar/Menu/MenuCardView.swift:1500-1507 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/Menu/MenuCardView.swift:1284` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/CodexBar/Providers/Codex/PreferencesCodexAccountsSection.swift:145— Sources/CodexBar/Providers/Codex/PreferencesCodexAccountsSection.swift:145-152 | Sources/CodexBar/Providers/Codex/PreferencesCodexAccountsSection.swift:250-258 — 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 (8 lines × 2) Sources/CodexBar/ShareStatsCardView.swift:246— Sources/CodexBar/ShareStatsCardView.swift:246-253 | Sources/CodexBar/ShareStatsCardView.swift:296-303 — 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 `Sources/CodexBar/ShareStatsCardView.swift:246` 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, `Sources/CodexBar/ShareStatsCardView.swift:294` calls `minimumScaleFactor` and `Sources/CodexBar/ShareStatsCardView.swift:244` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:133— Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:133-140 | Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:928-935 — 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 `Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:133` 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 (8 lines × 2) Sources/CodexBar/SpendDashboard/SpendSessionPerformanceView.swift:216— Sources/CodexBar/SpendDashboard/SpendSessionPerformanceView.swift:216-223 | Sources/CodexBar/SpendDashboard/SpendSessionPerformanceView.swift:275-282 — 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 (8 lines × 2) Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:382— Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:382-389 | Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:409-416 — 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 (8 lines × 2) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:639— Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:639-646 | Sources/CodexBar/UsageStore/UsageStore+SessionEquivalents.swift:35-42 — 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 `Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:639` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:121— Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:121-128 | Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:142-149 — 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 (8 lines × 2) Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:1213— Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:1213-1220 | Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:1482-1489 — 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 `Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:1213` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/CodexBarCLI/CLIGuardCommand.swift:246— Sources/CodexBarCLI/CLIGuardCommand.swift:246-254 | Sources/CodexBarCLI/CLIHooksWatchCommand.swift:150-157 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) Sources/CodexBarCLI/CLIIO.swift:98— Sources/CodexBarCLI/CLIIO.swift:98-105 | Sources/CodexBarCore/PathEnvironment.swift:1334-1341 — 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 `Sources/CodexBarCLI/CLIIO.swift:98` 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 (8 lines × 2) Sources/CodexBarCLI/CLIRenderer.swift:149— Sources/CodexBarCLI/CLIRenderer.swift:149-156 | Sources/CodexBarCLI/CLIRenderer.swift:1048-1059 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:621— Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:621-628 | Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:657-664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:777— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:777-784 | Sources/CodexBarCore/UsageFetcher.swift:1363-1370 — 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 (8 lines × 2) Sources/CodexBarCore/ProviderEndpointOverrideValidator.swift:102— Sources/CodexBarCore/ProviderEndpointOverrideValidator.swift:102-109 | Sources/CodexBarCore/ProviderEndpointOverrideValidator.swift:235-242 — 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:458— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:458-465 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:772-779 — 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 `Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:458` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:223— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:223-230 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:433-440 — 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 `Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:223` 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, `Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:231` calls `error` and `Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:441` 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) Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:974— Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:974-981 | Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:997-1004 — 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 (8 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:320— Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:320-327 | Sources/CodexBarCore/Providers/Codex/CodexCLISession.swift:232-239 — 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 `Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:320` 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) Sources/CodexBarCore/Providers/Codebuff/CodebuffSettingsReader.swift:31— Sources/CodexBarCore/Providers/Codebuff/CodebuffSettingsReader.swift:31-38 | Sources/CodexBarCore/Providers/Kilo/KiloSettingsReader.swift:15-22 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:53— Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:53-60 | Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:72-79 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:53` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:839— Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:839-846 | Sources/CodexBarCore/Providers/Warp/WarpUsageFetcher.swift:390-397 — 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 `Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:839` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:444— Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:444-451 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:494-501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:444` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIProviderDescriptor.swift:49— Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIProviderDescriptor.swift:49-56 | Sources/CodexBarCore/Providers/OpenRouter/OpenRouterProviderDescriptor.swift:74-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIProviderDescriptor.swift:49` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) Sources/CodexBarCore/Providers/StepFun/StepFunProviderDescriptor.swift:231— Sources/CodexBarCore/Providers/StepFun/StepFunProviderDescriptor.swift:231-238 | Sources/CodexBarCore/Providers/StepFun/StepFunProviderDescriptor.swift:248-255 — 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 `Sources/CodexBarCore/Providers/StepFun/StepFunProviderDescriptor.swift:231` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:573— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:573-579 | Sources/CodexBarCLI/CLICostCommand.swift:555-561 — 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 `Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:573` 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) Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:154— Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:154-160 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:231-237 — before extracting anything, compare `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift` and `Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 172 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) Sources/CodexBar/SessionQuotaNotifications.swift:586— Sources/CodexBar/SessionQuotaNotifications.swift:586-592 | Sources/CodexBar/SessionQuotaNotifications.swift:616-622 — 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) Sources/CodexBar/Settings/PreferencesProvidersPane.swift:200— Sources/CodexBar/Settings/PreferencesProvidersPane.swift:200-206 | Sources/CodexBar/Settings/PreferencesSidebar.swift:187-193 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) Sources/CodexBar/StatusItem/StatusItemController+CompactAccountMenu.swift:193— Sources/CodexBar/StatusItem/StatusItemController+CompactAccountMenu.swift:193-199 | Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:768-774 — 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) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1469— Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1469-1475 | Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1480-1486 — 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 `Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1469` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) Sources/CodexBarCore/BrowserCookieAccessGate.swift:125— Sources/CodexBarCore/BrowserCookieAccessGate.swift:125-131 | Sources/CodexBarCore/BrowserCookieAccessGate.swift:136-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) Sources/CodexBarCore/CostUsageModels.swift:1183— Sources/CodexBarCore/CostUsageModels.swift:1183-1189 | Sources/CodexBarCore/CostUsageModels.swift:1215-1221 — 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 `Sources/CodexBarCore/CostUsageModels.swift:1183` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 2) Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:1156— Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:1156-1162 | Sources/CodexBarCore/Providers/ProviderVersionDetector.swift:62-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:622— Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:622-628 | Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:643-649 — 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) Sources/CodexBarCore/ManagedCodexAccountStore.swift:107— Sources/CodexBarCore/ManagedCodexAccountStore.swift:107-113 | Sources/CodexBarCore/Providers/Codex/CodexOpenAIWorkspaceIdentityCache.swift:49-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:165— Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:165-171 | Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:558-564 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:165` 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) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:214— Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:214-220 | Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:129-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:196— Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:196-202 | Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift:107-116 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:125— Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:125-131 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:84-91 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:125` 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) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:415— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:415-421 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxBillingHistory.swift:353-359 — 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 (7 lines × 2) Sources/CodexBarCore/Providers/Grok/GrokWebBillingFetcher.swift:395— Sources/CodexBarCore/Providers/Grok/GrokWebBillingFetcher.swift:395-401 | Sources/CodexBarCore/Providers/Grok/GrokWebBillingFetcher.swift:452-458 — 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) Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:21— Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:21-27 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:91-97 — 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 `Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:21` 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) Sources/CodexBarCore/CodexThreadMetadataReader.swift:346— Sources/CodexBarCore/CodexThreadMetadataReader.swift:346-352 | Sources/CodexBarCore/Providers/Codex/CodexCLIBackendConfiguration.swift:176-182 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:353— Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:353-359 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:727-733 — 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 `Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:353` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:90— Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:90-96 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieHeaders.swift:142-148 — before extracting anything, compare `Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift` and `Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieHeaders.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) Sources/CodexBarCore/Providers/Groq/GroqConsoleFetcher.swift:178— Sources/CodexBarCore/Providers/Groq/GroqConsoleFetcher.swift:178-184 | Sources/CodexBarCore/Providers/Groq/GroqUsageFetcher.swift:195-201 — 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 `Sources/CodexBarCore/Providers/Groq/GroqConsoleFetcher.swift:178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:334— Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:334-340 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:682-688 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/CodexBarCore/Providers/Bedrock/BedrockAWSSigner.swift:152— Sources/CodexBarCore/Providers/Bedrock/BedrockAWSSigner.swift:152-158 | Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:447-453 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeCLIUsageSpawnThrottle.swift:115— Sources/CodexBarCore/Providers/Claude/ClaudeCLIUsageSpawnThrottle.swift:115-121 | Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:1395-1401 — 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.
+ 4 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×24
Edited copy of a member (10 corresponding lines) Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift:264— Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift:264-273 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageParser.swift:203-214 — 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) Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift:346— Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift:346-355 | Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift:357-371 — 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) Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:39— Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:39-48 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxCookieImporter.swift:52-63 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:1154— Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:1154-1164 | Sources/CodexBarCore/Providers/ProviderVersionDetector.swift:61-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) Sources/CodexBarCore/Providers/Antigravity/AntigravityQuotaSummaryParser.swift:162— Sources/CodexBarCore/Providers/Antigravity/AntigravityQuotaSummaryParser.swift:162-171 | Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:49-58 — 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) Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:13— Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:13-27 | Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:39-48 — 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) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1547— Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1547-1557 | Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1591-1600 — 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) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:573— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:573-582 | Sources/CodexBarCLI/CLICostCommand.swift:555-564 — 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) Sources/CodexBarCore/Providers/Grok/GrokAuth.swift:151— Sources/CodexBarCore/Providers/Grok/GrokAuth.swift:151-160 | Sources/CodexBarCore/Providers/VertexAI/VertexAIOAuth/VertexAIOAuthCredentials.swift:129-139 — 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) Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:768— Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:768-777 | Sources/CodexBar/Menu/MenuCardView.swift:579-590 — 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) Sources/CodexBarCLI/CLICardsBriefRenderer.swift:233— Sources/CodexBarCLI/CLICardsBriefRenderer.swift:233-248 | Sources/CodexBarCLI/CLICardsBriefRenderer.swift:380-389 — 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) Sources/CodexBar/UsageStore/UsageStore+HistoricalPace.swift:126— Sources/CodexBar/UsageStore/UsageStore+HistoricalPace.swift:126-138 | Sources/CodexBar/UsageStore/UsageStore+HistoricalPace.swift:140-149 — 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) Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:521— Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:521-530 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageParser.swift:19-28 — 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) Sources/CodexBarCore/Providers/OpenCode/OpenCodeProviderDescriptor.swift:123— Sources/CodexBarCore/Providers/OpenCode/OpenCodeProviderDescriptor.swift:123-132 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift:502-511 — 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) Sources/CodexBarCore/KeychainAccessGate.swift:37— Sources/CodexBarCore/KeychainAccessGate.swift:37-49 | Sources/CodexBarCore/KeychainAccessGate.swift:58-67 — 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) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:1464— Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:1464-1480 | Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:1510-1519 — 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) Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:57— Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:57-70 | Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1656-1665 — 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) Sources/CodexBarCore/CookieHeaderCache.swift:619— Sources/CodexBarCore/CookieHeaderCache.swift:619-628 | Sources/CodexBarCore/CookieHeaderCache.swift:665-674 — 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) Sources/CodexBar/Providers/Claude/UsageStore+ClaudeActiveAccountIdentity.swift:48— Sources/CodexBar/Providers/Claude/UsageStore+ClaudeActiveAccountIdentity.swift:48-58 | Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:1256-1265 — 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) Sources/CodexBarCore/Providers/Groq/GroqConsoleSession.swift:106— Sources/CodexBarCore/Providers/Groq/GroqConsoleSession.swift:106-115 | Sources/CodexBarCore/Providers/Groq/GroqConsoleSession.swift:117-126 — 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) Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:941— Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:941-950 | Sources/CodexBarCore/Providers/Wayfinder/WayfinderUsageFetcher.swift:406-415 — 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) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:733— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:733-742 | Sources/CodexBarCore/Providers/ProviderInstanceID.swift:23-32 — 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) Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:285— Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:285-294 | Sources/CodexBar/Providers/Codex/CodexConsumerProjection.swift:559-568 — 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) Sources/CodexBarCore/Providers/Antigravity/AntigravityUsageDataSource.swift:20— Sources/CodexBarCore/Providers/Antigravity/AntigravityUsageDataSource.swift:20-29 | Sources/CodexBarCore/Providers/Codex/CodexUsageDataSource.swift:22-33 — 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 (6 corresponding lines) · ×22
Edited copy of a member (6 corresponding lines) Sources/CodexBarCore/ManagedCodexAccountLock.swift:26— Sources/CodexBarCore/ManagedCodexAccountLock.swift:26-31 | Sources/CodexBarCore/ManagedCodexAccountLock.swift:33-40 — 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) Sources/CodexBarCLI/CLIRenderer.swift:183— Sources/CodexBarCLI/CLIRenderer.swift:183-188 | Sources/CodexBarCLI/CLIRenderer.swift:190-195 — 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) Sources/CodexBarWidget/BurnDownWidgetViews.swift:692— Sources/CodexBarWidget/BurnDownWidgetViews.swift:692-700 | Sources/CodexBarWidget/BurnDownWidgetViews.swift:723-728 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageFetcher.swift:259— Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageFetcher.swift:259-264 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:727-732 — 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) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:572— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:572-578 | Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:584-589 — 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) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:906— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:906-911 | Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:968-973 — 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) Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:87— Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:87-99 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift:121-126 — 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) Sources/CodexBarCLI/CLICardsBriefRenderer.swift:601— Sources/CodexBarCLI/CLICardsBriefRenderer.swift:601-606 | Sources/CodexBarCLI/CLICardsRenderer.swift:605-612 — 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) Sources/CodexBarCore/Providers/Codex/CodexPAT/CodexPATUsageFetcher.swift:101— Sources/CodexBarCore/Providers/Codex/CodexPAT/CodexPATUsageFetcher.swift:101-108 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:734-739 — 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) Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:355— Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:355-360 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoZenBalanceParser.swift:61-68 — 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) Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1458— Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1458-1467 | Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe+Deadline.swift:124-129 — 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) Sources/CodexBarCore/CodexThreadCatalogReader.swift:234— Sources/CodexBarCore/CodexThreadCatalogReader.swift:234-239 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleChromiumCookieFallbackImporter.swift:195-202 — 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) Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:106— Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:106-111 | Sources/CodexBarCore/Providers/CodeRabbit/CodeRabbitProviderDescriptor.swift:68-73 — 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) Sources/CodexBarCore/Providers/Codebuff/CodebuffSettingsReader.swift:48— Sources/CodexBarCore/Providers/Codebuff/CodebuffSettingsReader.swift:48-53 | Sources/CodexBarCore/Providers/Kilo/KiloSettingsReader.swift:32-37 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeCLIUsageSpawnThrottle.swift:69— Sources/CodexBarCore/Providers/Claude/ClaudeCLIUsageSpawnThrottle.swift:69-83 | Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:1387-1392 — 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) Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:607— Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:607-612 | TestsPlugin/T3ChatReference.swift:115-122 — 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) Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:218— Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:218-225 | Sources/CodexBar/Providers/StepFun/StepFunSettingsStore.swift:22-27 — 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) Sources/CodexBarCore/Providers/Devin/DevinUsageFetcher.swift:19— Sources/CodexBarCore/Providers/Devin/DevinUsageFetcher.swift:19-29 | Sources/CodexBarCore/Providers/Kimi/KimiModels.swift:157-162 — 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) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:242— Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:242-247 | Sources/CodexBarCore/Providers/Providers.swift:9-17 — 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) Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:1093— Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:1093-1098 | Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:1118-1125 — 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) Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:473— Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:473-478 | Sources/CodexBarCore/Providers/Codex/CodexCLIDashboardAuthorityContext.swift:51-56 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageFetcher.swift:266— Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageFetcher.swift:266-271 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:323-328 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×22
Edited copy of a member (4 corresponding lines) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:128— Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:128-131 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxCookieImporter.swift:112-115 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:3284— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:3284-3289 | Sources/CodexBarCore/Providers/VertexAI/VertexAIOAuth/VertexAITokenRefresher.swift:107-110 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:125— Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:125-128 | Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:422-425 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:689— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:689-692 | Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:121-124 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBar/UsageStore/UsageStore+LimitResetCelebration.swift:549— Sources/CodexBar/UsageStore/UsageStore+LimitResetCelebration.swift:549-555 | Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:1452-1455 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBarCore/Providers/Devin/DevinSessionImporter.swift:402— Sources/CodexBarCore/Providers/Devin/DevinSessionImporter.swift:402-405 | Sources/CodexBarCore/Providers/Devin/DevinUsageFetcher.swift:313-320 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:33— Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:33-36 | Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageSnapshot.swift:34-37 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountSwitch.swift:109— Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountSwitch.swift:109-116 | Sources/CodexBarCore/Providers/Muse/MuseLocalUsageReader.swift:564-567 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBar/Menu/MenuCardView.swift:1153— Sources/CodexBar/Menu/MenuCardView.swift:1153-1156 | Sources/CodexBar/Menu/MenuDescriptor.swift:533-536 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthCredentials.swift:460— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthCredentials.swift:460-463 | Sources/CodexBarCore/Providers/Grok/GrokAuth.swift:220-223 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:555— Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:555-560 | Sources/CodexBarCore/SessionToolActivityParser.swift:103-106 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:493— Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:493-496 | Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:289-292 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBarCore/Providers/Codex/CodexVisibleAccountProjection.swift:97— Sources/CodexBarCore/Providers/Codex/CodexVisibleAccountProjection.swift:97-100 | Sources/CodexBarCore/Providers/Windsurf/WindsurfDevinSessionImporter.swift:276-279 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:452— Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:452-455 | TestsPlugin/T3ChatReference.swift:108-113 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBar/Menu/UsageProgressBar.swift:367— Sources/CodexBar/Menu/UsageProgressBar.swift:367-370 | Sources/CodexBarWidget/WidgetDesignSystem.swift:305-308 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBar/HTTPServerConfiguration.swift:16— Sources/CodexBar/HTTPServerConfiguration.swift:16-19 | Sources/CodexBarCLI/CLIServeAuth.swift:55-58 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:806— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:806-809 | Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:223-226 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBar/ShareStatsPayload.swift:327— Sources/CodexBar/ShareStatsPayload.swift:327-330 | Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1440-1443 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBarCore/Providers/Grok/GrokRPCClient.swift:100— Sources/CodexBarCore/Providers/Grok/GrokRPCClient.swift:100-103 | Sources/CodexBarCore/UsageFetcher.swift:1084-1087 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBarCore/Providers/Mistral/MistralCookieImporter.swift:80— Sources/CodexBarCore/Providers/Mistral/MistralCookieImporter.swift:80-85 | Sources/CodexBarCore/Providers/Replicate/ReplicateCookieImporter.swift:45-48 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:986— Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:986-989 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardWebViewCache.swift:600-603 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/CodexBar/Providers/Gemini/GeminiProviderImplementation.swift:25— Sources/CodexBar/Providers/Gemini/GeminiProviderImplementation.swift:25-28 | Sources/CodexBar/Providers/OpenCodeGo/OpenCodeGoProviderImplementation.swift:19-22 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (11 lines × 2) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:198— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:198-208 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:93-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:198` 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) Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:81— Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:81-91 | Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:205-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) Sources/CodexBar/Providers/Codex/CodexAccountSwitcherView.swift:203— Sources/CodexBar/Providers/Codex/CodexAccountSwitcherView.swift:203-213 | Sources/CodexBar/Providers/Codex/CodexAccountSwitcherView.swift:229-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:358— Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:358-368 | Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:379-389 — 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 `Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:358` 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 (11 lines × 2) Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift:266— Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift:266-276 | Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift:316-326 — 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 `Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift:266` 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 (11 lines × 2) Sources/CodexBarCore/CookieHeaderCache.swift:292— Sources/CodexBarCore/CookieHeaderCache.swift:292-302 | Sources/CodexBarCore/CookieHeaderCache.swift:951-961 — 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 `Sources/CodexBarCore/CookieHeaderCache.swift:292` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 2) Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:943— Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:943-953 | Sources/CodexBarCore/Providers/Codex/CodexCLISession.swift:102-112 — 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 `Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:943` 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) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1097— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1097-1107 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1122-1132 — 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 `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1097` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:167— Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:167-177 | Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:196-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:513— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:513-523 | Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:548-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:513` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:487— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:487-497 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudTokenPlanAPIClient.swift:91-101 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:487` 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) Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:207— Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:207-217 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:620-630 — 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 `Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift: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 (11 lines × 2) Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:43— Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:43-53 | Sources/CodexBarCore/Providers/Codebuff/CodebuffProviderDescriptor.swift:50-60 — 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 `Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:43` 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) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:414— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:414-424 | Sources/CodexBarCore/Providers/Codex/CodexPAT/CodexPATUsageFetcher.swift:89-99 — 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 `Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:414` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:600— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:600-610 | Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:615-625 — 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 `Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:600` 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) Sources/CodexBarCore/Providers/Notion/NotionProviderDescriptor.swift:132— Sources/CodexBarCore/Providers/Notion/NotionProviderDescriptor.swift:132-142 | Sources/CodexBarCore/Providers/ZoomMate/ZoomMateProviderDescriptor.swift:77-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Notion/NotionProviderDescriptor.swift:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:160— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:160-170 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:171-181 — 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 (11 lines × 2) Sources/CodexBarCore/Providers/Codex/CodexPAT/CodexPATFetchStrategy.swift:140— Sources/CodexBarCore/Providers/Codex/CodexPAT/CodexPATFetchStrategy.swift:140-150 | Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift:536-546 — 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 `Sources/CodexBarCore/Providers/Codex/CodexPAT/CodexPATFetchStrategy.swift:140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift:38— Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift:38-48 | Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift:115-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:412— Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:412-422 | Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:465-475 — 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 `Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift: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.
Duplicated block (11 lines × 2) Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:98— Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:98-108 | Sources/CodexBarCore/Providers/Perplexity/PerplexityCookieImporter.swift:124-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, `Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:110` calls `invalidateImportSessionCache`, `invalidate` and `Sources/CodexBarCore/Providers/Perplexity/PerplexityCookieImporter.swift:136` 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) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:98— Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:98-108 | Sources/CodexBarCore/Providers/Codex/CodexStatusProbe.swift:72-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×21
Edited copy of a member (15 corresponding lines) Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieHeader.swift:44— Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieHeader.swift:44-67 | Sources/CodexBarCore/Providers/Perplexity/PerplexityCookieHeader.swift:61-75 — 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) Sources/CodexBarCore/CookieHeaderNormalizer.swift:36— Sources/CodexBarCore/CookieHeaderNormalizer.swift:36-56 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:88-102 — 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) Sources/CodexBar/Menu/StorageBreakdownMenuView.swift:245— Sources/CodexBar/Menu/StorageBreakdownMenuView.swift:245-259 | Sources/CodexBar/Menu/StorageBreakdownMenuView.swift:347-367 — 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) Sources/CodexBar/SessionQuotaNotifications.swift:626— Sources/CodexBar/SessionQuotaNotifications.swift:626-640 | Sources/CodexBar/SessionQuotaNotifications.swift:642-656 — 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) Sources/CodexBarCore/Providers/Kimi/KimiUsageFetcher.swift:226— Sources/CodexBarCore/Providers/Kimi/KimiUsageFetcher.swift:226-240 | Sources/CodexBarCore/Providers/Kimi/KimiUsageFetcher.swift:320-339 — 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) Sources/CodexBar/PredictivePaceWarnings.swift:33— Sources/CodexBar/PredictivePaceWarnings.swift:33-47 | Sources/CodexBar/Providers/Codex/UpcomingResetNotifications.swift:48-65 — 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) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1139— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1139-1154 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1156-1170 — 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) Sources/CodexBarCore/Providers/Factory/FactoryLocalStorageImporter.swift:300— Sources/CodexBarCore/Providers/Factory/FactoryLocalStorageImporter.swift:300-314 | Sources/CodexBarCore/Providers/Windsurf/WindsurfStatusProbe.swift:119-133 — 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) Sources/CodexBarCore/Providers/Windsurf/WindsurfDevinSessionImporter.swift:92— Sources/CodexBarCore/Providers/Windsurf/WindsurfDevinSessionImporter.swift:92-106 | Sources/CodexBarCore/Providers/Windsurf/WindsurfDevinSessionImporter.swift:108-122 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageFetcher.swift:87— Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageFetcher.swift:87-101 | Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageFetcher.swift:103-117 — 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) Sources/CodexBar/SpendDashboard/SpendDashboardPublication.swift:99— Sources/CodexBar/SpendDashboard/SpendDashboardPublication.swift:99-113 | Sources/CodexBar/SpendDashboard/SpendDashboardPublication.swift:115-129 — 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) Sources/CodexBarCore/Providers/Windsurf/WindsurfWebFetcher.swift:394— Sources/CodexBarCore/Providers/Windsurf/WindsurfWebFetcher.swift:394-408 | Sources/CodexBarCore/Providers/Windsurf/WindsurfWebFetcher.swift:480-497 — 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) Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:676— Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:676-691 | Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:693-707 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:489— Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:489-503 | Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:566-580 — 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) Sources/CodexBarCore/TokenAccounts.swift:92— Sources/CodexBarCore/TokenAccounts.swift:92-106 | Sources/CodexBarCore/TokenAccounts.swift:133-147 — 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) Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:355— Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:355-371 | Sources/CodexBarCore/CodexLocalProjectUsageProjection.swift:83-97 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthUsageFetcher.swift:252— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthUsageFetcher.swift:252-268 | Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:164-178 — 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) Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift:864— Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift:864-878 | Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift:880-894 — 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) Sources/CodexBarCore/Providers/Mistral/MistralCookieImporter.swift:95— Sources/CodexBarCore/Providers/Mistral/MistralCookieImporter.swift:95-109 | Sources/CodexBarCore/Providers/OpenCode/OpenCodeCookieImporter.swift:69-83 — 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) Sources/CodexBarCore/CodexModelsAnalyticsModels.swift:318— Sources/CodexBarCore/CodexModelsAnalyticsModels.swift:318-332 | Sources/CodexBarCore/ProviderStorageFootprint.swift:31-47 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:99— Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:99-113 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift:99-113 — 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 (9 corresponding lines) · ×21
Edited copy of a member (9 corresponding lines) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:295— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:295-305 | Sources/CodexBarCore/UsageFetcher.swift:949-957 — 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) Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:780— Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:780-793 | Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:823-831 — 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) Sources/CodexBarCore/UsageFormatter.swift:429— Sources/CodexBarCore/UsageFormatter.swift:429-437 | Sources/CodexBarCore/UsageFormatter.swift:439-447 — 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) Sources/CodexBarCore/Providers/Groq/GroqConsoleFetcher.swift:143— Sources/CodexBarCore/Providers/Groq/GroqConsoleFetcher.swift:143-151 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:526-534 — 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) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalJSONL.swift:140— Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalJSONL.swift:140-150 | Sources/CodexBarCore/Providers/Muse/MuseLocalUsageReader.swift:569-577 — 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) Sources/CodexBarCore/Host/Process/ProcessPipeCapture.swift:95— Sources/CodexBarCore/Host/Process/ProcessPipeCapture.swift:95-103 | Sources/CodexBarCore/Host/Process/ProcessPipeCapture.swift:107-115 — 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) Sources/CodexBarCore/Providers/Windsurf/WindsurfDevinSessionImporter.swift:254— Sources/CodexBarCore/Providers/Windsurf/WindsurfDevinSessionImporter.swift:254-262 | Sources/CodexBarCore/Providers/Windsurf/WindsurfDevinSessionImporter.swift:264-274 — 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) Sources/CodexBarCore/CookieHeaderNormalizer.swift:87— Sources/CodexBarCore/CookieHeaderNormalizer.swift:87-95 | Sources/CodexBarCore/Providers/Moonshot/MoonshotSettingsReader.swift:64-72 — 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) Sources/CodexBarCore/KeychainCacheStore.swift:743— Sources/CodexBarCore/KeychainCacheStore.swift:743-753 | Sources/CodexBarCore/KeychainCacheStore.swift:755-763 — 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) Sources/CodexBarCore/Plugins/ProviderPluginCookieJar.swift:20— Sources/CodexBarCore/Plugins/ProviderPluginCookieJar.swift:20-28 | Sources/CodexBarCore/Plugins/ProviderPluginCookieJar.swift:31-39 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) Sources/CodexBarCLI/CLIRenderer.swift:148— Sources/CodexBarCLI/CLIRenderer.swift:148-156 | Sources/CodexBarCLI/CLIRenderer.swift:158-166 — 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) Sources/CodexBarCore/BrowserCookieAccessGate.swift:441— Sources/CodexBarCore/BrowserCookieAccessGate.swift:441-449 | Sources/CodexBarCore/BrowserCookieAccessGate.swift:453-461 — 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) Sources/CodexBar/Providers/Helmcode/HelmcodeProviderImplementation.swift:7— Sources/CodexBar/Providers/Helmcode/HelmcodeProviderImplementation.swift:7-15 | Sources/CodexBar/Providers/Kimi/KimiProviderImplementation.swift:23-32 — 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) Sources/CodexBar/Providers/Codex/UsageStore+CodexWeeklyResetConfirmation.swift:305— Sources/CodexBar/Providers/Codex/UsageStore+CodexWeeklyResetConfirmation.swift:305-315 | Sources/CodexBar/Providers/Codex/UsageStore+CodexWeeklyResetConfirmation.swift:317-325 — 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) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1134— Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1134-1145 | Sources/CodexBar/StatusItem/StatusItemController+ProviderNavigation.swift:89-97 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:42— Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:42-53 | Sources/CodexBarCore/Providers/Grok/GrokCredentialRouting.swift:52-60 — 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) Sources/CodexBarCore/PiFamilySessionRootResolver.swift:238— Sources/CodexBarCore/PiFamilySessionRootResolver.swift:238-248 | Sources/CodexBarCore/PiFamilySessionRootResolver.swift:250-258 — 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) Sources/CodexBarCore/Plugins/ProviderPluginCookieJar.swift:205— Sources/CodexBarCore/Plugins/ProviderPluginCookieJar.swift:205-213 | Sources/CodexBarCore/ProviderHTTPClient.swift:219-227 — 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) Sources/CodexBarCLI/CLIDashboardCommand.swift:351— Sources/CodexBarCLI/CLIDashboardCommand.swift:351-359 | Sources/CodexBarCore/CredentialFileWriter.swift:92-100 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeConfigPaths.swift:9— Sources/CodexBarCore/Providers/Claude/ClaudeConfigPaths.swift:9-17 | Sources/CodexBarCore/Providers/Claude/ClaudeConfigPaths.swift:103-111 — 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) Sources/CodexBar/StatusItem/StatusItemController+OverviewSpend.swift:82— Sources/CodexBar/StatusItem/StatusItemController+OverviewSpend.swift:82-91 | Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1450-1458 — 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.
Change coupling: ProviderPluginSnapshotMapper.swift ↔ codexbar-plugin.d.ts Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:1— `Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift` and `Sources/CodexBarCore/Resources/Plugins/codexbar-plugin.d.ts` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `0e949181` feat(plugins): show configurable multi-quota menu-bar summaries; `aa7862ab` feat(plugins): allow built-in provider branding per snapshot; `aa029218` feat(plugins): allow detail rows to show a pace marker (#4776) — run `git show` on any of them.
Change coupling: SettingsStore+MenuObservation.swift ↔ SettingsStoreState.swift Sources/CodexBar/Settings/SettingsStore+MenuObservation.swift:1— `Sources/CodexBar/Settings/SettingsStore+MenuObservation.swift` and `Sources/CodexBar/Settings/SettingsStoreState.swift` change together 76% of the time (26 of the 34 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 26 shared commits counted here, the most recent 3 are `2f232d6f` Add color by provider setting and preference persistence (at that commit the files were still `Sources/CodexBar/SettingsStore+MenuObservation.swift` and `Sources/CodexBar/SettingsStoreState.swift`); `39b17af0` Add spend provenance, pinned day timezone, and Codex fork fail-closed. (at that commit the files were still `Sources/CodexBar/SettingsStore+MenuObservation.swift` and `Sources/CodexBar/SettingsStoreState.swift`); `afe28dd8` feat: add automatic low-power preference (at that commit the files were still `Sources/CodexBar/SettingsStore+MenuObservation.swift` and `Sources/CodexBar/SettingsStoreState.swift`) — run `git show` on any of them.
Change coupling: StatusItemController+Actions.swift ↔ StatusItemController+PersistentMenuActions.swift Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:1— `Sources/CodexBar/StatusItem/StatusItemController+Actions.swift` and `Sources/CodexBar/StatusItem/StatusItemController+PersistentMenuActions.swift` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `e9da0796` feat: add first-class plugin switcher tabs (#3516) (at that commit the files were still `Sources/CodexBar/StatusItemController+Actions.swift` and `Sources/CodexBar/StatusItemController+PersistentMenuActions.swift`); `dbfd1959` Fix stranded menu scroll after a manual refresh clears a provider err… (at that commit the files were still `Sources/CodexBar/StatusItemController+Actions.swift` and `Sources/CodexBar/StatusItemController+PersistentMenuActions.swift`); `e3c2adeb` fix: scope provider refresh state (#1911) (at that commit the files were still `Sources/CodexBar/StatusItemController+Actions.swift` and `Sources/CodexBar/StatusItemController+PersistentMenuActions.swift`) — run `git show` on any of them.
Change coupling: KeychainPromptCoordinator.swift ↔ SettingsStore.swift Sources/CodexBar/KeychainPromptCoordinator.swift:1— `Sources/CodexBar/KeychainPromptCoordinator.swift` and `Sources/CodexBar/Settings/SettingsStore.swift` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `dd54a28d` Add Chinese (Simplified) localization (#819) (at that commit the file was still `Sources/CodexBar/SettingsStore.swift`); `8799099b` feat: add synthetic provider (at that commit the file was still `Sources/CodexBar/SettingsStore.swift`); `7c1d0a2b` wip (at that commit the file was still `Sources/CodexBar/SettingsStore.swift`) — run `git show` on any of them.
Change coupling: MenuCardView.swift ↔ VertexAIProviderDescriptor.swift Sources/CodexBar/Menu/MenuCardView.swift:1— `Sources/CodexBar/Menu/MenuCardView.swift` and `Sources/CodexBarCore/Providers/VertexAI/VertexAIProviderDescriptor.swift` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `6838b449` feat(vertex): add direct token cost tracking with _vrtx_ detection (at that commit the file was still `Sources/CodexBar/MenuCardView.swift`); `15dcdbb9` fix(vertex): disable direct token cost tracking to avoid double-counting (at that commit the file was still `Sources/CodexBar/MenuCardView.swift`); `5a04e57c` feat(vertexai): add token cost tracking for Vertex AI Claude usage (at that commit the file was still `Sources/CodexBar/MenuCardView.swift`) — run `git show` on any of them.
Change coupling: ProviderTokenResolver.swift ↔ CodexBarWidgetViews.swift Sources/CodexBarCore/Providers/ProviderTokenResolver.swift:1— `Sources/CodexBarCore/Providers/ProviderTokenResolver.swift` and `Sources/CodexBarWidget/CodexBarWidgetViews.swift` change together 62% of the time (16 of the 26 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `479e1284` Add Neuralwatt provider; `3cb9d0d9` Add ClinePass usage provider; `87b11959` Add LiteLLM provider (#1542) — run `git show` on any of them.
Change coupling: ProviderTokenResolver.swift ↔ CodexBarWidgetProvider.swift Sources/CodexBarCore/Providers/ProviderTokenResolver.swift:1— `Sources/CodexBarCore/Providers/ProviderTokenResolver.swift` and `Sources/CodexBarWidget/CodexBarWidgetProvider.swift` change together 62% of the time (16 of the 26 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `479e1284` Add Neuralwatt provider; `3cb9d0d9` Add ClinePass usage provider; `87b11959` Add LiteLLM provider (#1542) — run `git show` on any of them.
Change coupling: StatusItemController+MenuReconcile.swift ↔ StatusItemController+MenuSmartUpdate.swift Sources/CodexBar/StatusItem/StatusItemController+MenuReconcile.swift:1— `Sources/CodexBar/StatusItem/StatusItemController+MenuReconcile.swift` and `Sources/CodexBar/StatusItem/StatusItemController+MenuSmartUpdate.swift` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `cd49d30f` Swap SwiftUI payloads across menu tab switches instead of detaching v… (at that commit the files were still `Sources/CodexBar/StatusItemController+MenuReconcile.swift` and `Sources/CodexBar/StatusItemController+MenuSmartUpdate.swift`); `6d467b6a` Warm sibling switcher tabs after menu open for flicker-free switches (at that commit the files were still `Sources/CodexBar/StatusItemController+MenuReconcile.swift` and `Sources/CodexBar/StatusItemController+MenuSmartUpdate.swift`); `3adca574` Flush hosted menu rows synchronously during provider tab switches (at that commit the files were still `Sources/CodexBar/StatusItemController+MenuReconcile.swift` and `Sources/CodexBar/StatusItemController+MenuSmartUpdate.swift`) — run `git show` on any of them.
Change coupling: CLIConfigCommand.swift ↔ CLIHelp.swift Sources/CodexBarCLI/CLIConfigCommand.swift:1— `Sources/CodexBarCLI/CLIConfigCommand.swift` and `Sources/CodexBarCLI/CLIHelp.swift` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9f026e03` feat(cli): add config set-cookie and clear-credential (#4765); `73040e26` fix(cli): accept all|both provider values in hooks watch; `e916f693` Add CLI command to persist provider source — run `git show` on any of them.
Change coupling: PredictivePaceWarnings.swift ↔ UsageStore+Refresh.swift Sources/CodexBar/PredictivePaceWarnings.swift:1— `Sources/CodexBar/PredictivePaceWarnings.swift` and `Sources/CodexBar/UsageStore/UsageStore+Refresh.swift` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `0ada5de3` fix(claude): keep warnings for unresolved accounts (#3813) (at that commit the file was still `Sources/CodexBar/UsageStore+Refresh.swift`); `cc244d70` fix(claude): preserve verified quota warning history (#3813) (at that commit the file was still `Sources/CodexBar/UsageStore+Refresh.swift`); `a9dc8229` Scope quota warnings to accounts (at that commit the file was still `Sources/CodexBar/UsageStore+Refresh.swift`) — run `git show` on any of them.
Change coupling: ClaudeProviderImplementation.swift ↔ MiniMaxProviderImplementation.swift Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift:1— `Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift` and `Sources/CodexBar/Providers/MiniMax/MiniMaxProviderImplementation.swift` change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `1d7ae093` Memoize cookie cache lookups behind settings picker labels; `b327b14b` refactor: push menu and snapshot hooks to providers; `be6c18aa` refactor: move provider settings and token hooks — run `git show` on any of them.
Change coupling: CostUsageFetcher.swift ↔ VertexAIProviderDescriptor.swift Sources/CodexBarCore/CostUsageFetcher.swift:1— `Sources/CodexBarCore/CostUsageFetcher.swift` and `Sources/CodexBarCore/Providers/VertexAI/VertexAIProviderDescriptor.swift` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `6838b449` feat(vertex): add direct token cost tracking with _vrtx_ detection; `15dcdbb9` fix(vertex): disable direct token cost tracking to avoid double-counting; `5a04e57c` feat(vertexai): add token cost tracking for Vertex AI Claude usage — run `git show` on any of them.
Change coupling: ProviderRegistry.swift ↔ OpenCodeProviderImplementation.swift Sources/CodexBar/ProviderRegistry.swift:1— `Sources/CodexBar/ProviderRegistry.swift` and `Sources/CodexBar/Providers/OpenCode/OpenCodeProviderImplementation.swift` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `b327b14b` refactor: push menu and snapshot hooks to providers; `be6c18aa` refactor: move provider settings and token hooks; `be490316` fix: require manual cookies without keychain — run `git show` on any of them.
Change coupling: UsageStore+CodexCostCatchUp.swift ↔ UsageStore+SpendDashboardCodexCostCatchUp.swift Sources/CodexBar/Providers/Codex/UsageStore+CodexCostCatchUp.swift:1— `Sources/CodexBar/Providers/Codex/UsageStore+CodexCostCatchUp.swift` and `Sources/CodexBar/Providers/Codex/UsageStore+SpendDashboardCodexCostCatchUp.swift` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `411e4960` Fix empty Codex cost scan recovery and completed stalls (at that commit the files were still `Sources/CodexBar/UsageStore+CodexCostCatchUp.swift` and `Sources/CodexBar/UsageStore+SpendDashboardCodexCostCatchUp.swift`); `c0915b58` fix(codex): continue automatic cost discovery in a bounded burst (#4237) (at that commit the files were still `Sources/CodexBar/UsageStore+CodexCostCatchUp.swift` and `Sources/CodexBar/UsageStore+SpendDashboardCodexCostCatchUp.swift`); `93762299` fix(codex): exclude queue waiting from catch-up delays (at that commit the files were still `Sources/CodexBar/UsageStore+CodexCostCatchUp.swift` and `Sources/CodexBar/UsageStore+SpendDashboardCodexCostCatchUp.swift`) — run `git show` on any of them.
Change coupling: PreferencesProvidersPane.swift ↔ SettingsStore+MenuPreferences.swift Sources/CodexBar/Settings/PreferencesProvidersPane.swift:1— `Sources/CodexBar/Settings/PreferencesProvidersPane.swift` and `Sources/CodexBar/Settings/SettingsStore+MenuPreferences.swift` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `d71d92f8` feat: add combined Codex usage metric (at that commit the files were still `Sources/CodexBar/PreferencesProvidersPane.swift` and `Sources/CodexBar/SettingsStore+MenuPreferences.swift`); `c7f38669` feat: show balance metrics for API-balance providers (at that commit the files were still `Sources/CodexBar/PreferencesProvidersPane.swift` and `Sources/CodexBar/SettingsStore+MenuPreferences.swift`); `a6b03428` Add Cursor extra usage menu bar metric (at that commit the files were still `Sources/CodexBar/PreferencesProvidersPane.swift` and `Sources/CodexBar/SettingsStore+MenuPreferences.swift`) — run `git show` on any of them.
Change coupling: ManagedCodexAccountService.swift ↔ CodexAccountPromotionExecution.swift Sources/CodexBar/Providers/Codex/ManagedCodexAccountService.swift:1— `Sources/CodexBar/Providers/Codex/ManagedCodexAccountService.swift` and `Sources/CodexBarCore/Providers/Codex/CodexAccountPromotionExecution.swift` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `bcc4c567` feat(codex-accounts): log redacted registry mutations for account-los… (at that commit the file was still `Sources/CodexBar/ManagedCodexAccountService.swift`); `79a43f74` fix(codex): retain shared managed homes through cleanup (at that commit the file was still `Sources/CodexBar/ManagedCodexAccountService.swift`); `5e9bbaa3` fix(codex): guard managed home deletion when another record reference… (at that commit the file was still `Sources/CodexBar/ManagedCodexAccountService.swift`) — run `git show` on any of them.
Change coupling: ProviderRegistry.swift ↔ TokenAccountSupport.swift Sources/CodexBar/ProviderRegistry.swift:1— `Sources/CodexBar/ProviderRegistry.swift` and `Sources/CodexBarCore/TokenAccountSupport.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `aa8977ef` feat: add Claude Admin API usage source; `f8d7dc39` refactor: streamline provider registries and snapshots; `e680a09f` fix: tighten amp provider wiring (#167) (thanks @duailibe) — run `git show` on any of them.
Change coupling: CLIDashboardCommand.swift ↔ CLIServeWebUI+HTML.swift Sources/CodexBarCLI/CLIDashboardCommand.swift:1— `Sources/CodexBarCLI/CLIDashboardCommand.swift` and `Sources/CodexBarCLI/CLIServeWebUI+HTML.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `d56adeae` Serve existing accounts with private dashboard defaults; `18dd6ffb` fix(serve): honor usage bar fill preference (#3670); `6ed9d98e` fix(claude): keep at-limit claude-swap cards complete (#3081) — run `git show` on any of them.
Change coupling: KeychainPromptCoordinator.swift ↔ PreferencesProvidersPane.swift Sources/CodexBar/KeychainPromptCoordinator.swift:1— `Sources/CodexBar/KeychainPromptCoordinator.swift` and `Sources/CodexBar/Settings/PreferencesProvidersPane.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `dd54a28d` Add Chinese (Simplified) localization (#819) (at that commit the file was still `Sources/CodexBar/PreferencesProvidersPane.swift`); `8799099b` feat: add synthetic provider (at that commit the file was still `Sources/CodexBar/PreferencesProvidersPane.swift`); `c917fd0f` refactor: convert MiniMax from cookie-based to API token authentication (at that commit the file was still `Sources/CodexBar/PreferencesProvidersPane.swift`) — run `git show` on any of them.
Change coupling: CLICookieCommand.swift ↔ CLIHelp.swift Sources/CodexBarCLI/CLICookieCommand.swift:1— `Sources/CodexBarCLI/CLICookieCommand.swift` and `Sources/CodexBarCLI/CLIHelp.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `fb44dd67` fix: make cookie refresh non-destructive; `b9089b9a` fix: preserve scoped cookie caches during refresh; `aa7b3224` fix: gate CLI cookie refresh — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×20
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:718— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:718-722 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1006-1008 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:895— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:895-897 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1016-1018 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/ProviderEndpointOverrideValidator.swift:224— Sources/CodexBarCore/ProviderEndpointOverrideValidator.swift:224-226 | Sources/CodexBarCore/Providers/Mistral/MistralSubscriptionBudgetParser.swift:201-203 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:744— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:744-746 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1038-1040 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:748— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:748-750 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1046-1048 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:752— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:752-754 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1050-1052 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:724— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:724-726 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1010-1012 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:732— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:732-734 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1030-1032 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:736— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:736-738 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1014-1016 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:249— Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:249-251 | Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:162-164 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/BrowserCookieAccessGate.swift:276— Sources/CodexBarCore/BrowserCookieAccessGate.swift:276-279 | Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:117-119 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/AzureOpenAI/AzureOpenAISettingsReader.swift:27— Sources/CodexBarCore/Providers/AzureOpenAI/AzureOpenAISettingsReader.swift:27-29 | Sources/CodexBarCore/Providers/OpenRouter/OpenRouterSettingsReader.swift:47-49 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/Deepgram/DeepgramSettingsReader.swift:15— Sources/CodexBarCore/Providers/Deepgram/DeepgramSettingsReader.swift:15-19 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPISettingsReader.swift:20-22 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBar/PredictivePaceWarnings.swift:94— Sources/CodexBar/PredictivePaceWarnings.swift:94-96 | Sources/CodexBar/UsagePaceText.swift:159-161 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/Doubao/DoubaoProviderDescriptor.swift:246— Sources/CodexBarCore/Providers/Doubao/DoubaoProviderDescriptor.swift:246-248 | Sources/CodexBarCore/Providers/Wayfinder/WayfinderUsageFetcher.swift:426-428 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/QwenCloud/QwenCloudUsageFetcher.swift:243— Sources/CodexBarCore/Providers/QwenCloud/QwenCloudUsageFetcher.swift:243-248 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudUsageParser.swift:30-32 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift:57— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift:57-59 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudCookieHeader.swift:51-53 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:225— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:225-228 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:153-155 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:127— Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:127-129 | Sources/CodexBarCore/Providers/Perplexity/PerplexityCookieImporter.swift:18-20 — 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.
Edited copy of a member (3 corresponding lines) Sources/CodexBarCore/OpenAIDashboardModels.swift:232— Sources/CodexBarCore/OpenAIDashboardModels.swift:232-237 | Sources/CodexBarCore/Providers/AzureOpenAI/AzureOpenAIUsageFetcher.swift:229-231 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×19
Edited copy of a member (13 corresponding lines) Sources/CodexBarCore/Providers/Nous/NousSettingsReader.swift:246— Sources/CodexBarCore/Providers/Nous/NousSettingsReader.swift:246-258 | Sources/CodexBarCore/UsageFetcher.swift:1570-1584 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift:338— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift:338-350 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift:352-366 — 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) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalJSONL.swift:10— Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalJSONL.swift:10-22 | Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSQLite.swift:9-30 — 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) Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:404— Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:404-419 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:829-841 — 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) Sources/CodexBarCore/CookieHeaderCache+Fingerprint.swift:9— Sources/CodexBarCore/CookieHeaderCache+Fingerprint.swift:9-21 | Sources/CodexBarCore/CookieHeaderCache.swift:86-98 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeRateLimitResetCredits.swift:37— Sources/CodexBarCore/Providers/Claude/ClaudeRateLimitResetCredits.swift:37-52 | Sources/CodexBarCore/Providers/Grok/GrokRemainingResetsFetcher.swift:262-274 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) Sources/CodexBar/Providers/Venice/VeniceProviderImplementation.swift:83— Sources/CodexBar/Providers/Venice/VeniceProviderImplementation.swift:83-97 | Sources/CodexBar/Providers/Zed/ZedProviderImplementation.swift:28-40 — 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) Sources/CodexBarCore/AgentSession.swift:475— Sources/CodexBarCore/AgentSession.swift:475-487 | Sources/CodexBarCore/AgentSession.swift:548-562 — 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) Sources/CodexBarCore/CostUsageModels.swift:123— Sources/CodexBarCore/CostUsageModels.swift:123-135 | Sources/CodexBarCore/CostUsageModels.swift:149-161 — 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) Sources/CodexBar/Menu/UsageProgressBar.swift:275— Sources/CodexBar/Menu/UsageProgressBar.swift:275-287 | Sources/CodexBar/Menu/UsageProgressBar.swift:289-301 — 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) Sources/CodexBar/UsageStore/UsageStore+SpendDashboardTokenCost.swift:221— Sources/CodexBar/UsageStore/UsageStore+SpendDashboardTokenCost.swift:221-234 | Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift:320-332 — 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) Sources/CodexBar/Localization.swift:63— Sources/CodexBar/Localization.swift:63-75 | Sources/CodexBar/Localization.swift:77-89 — 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) Sources/CodexBar/Providers/Codex/UsageStore+CodexResetCredits.swift:111— Sources/CodexBar/Providers/Codex/UsageStore+CodexResetCredits.swift:111-123 | Sources/CodexBar/Providers/Codex/UsageStore+CodexResetCredits.swift:125-137 — 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) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanCookieImporter.swift:93— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanCookieImporter.swift:93-105 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudCookieImporter.swift:35-49 — 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) Sources/CodexBar/UsageStore/UsageStore.swift:1327— Sources/CodexBar/UsageStore/UsageStore.swift:1327-1339 | Sources/CodexBar/UsageStore/UsageStore.swift:1341-1355 — 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) Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageFetcher.swift:16— Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageFetcher.swift:16-28 | Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageFetcher.swift:30-43 — 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) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:78— Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:78-90 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:93-105 — 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) Sources/CodexBar/StatusItem/StatusItemController+IconPerf.swift:10— Sources/CodexBar/StatusItem/StatusItemController+IconPerf.swift:10-22 | Sources/CodexBar/StatusItem/StatusItemController.swift:617-629 — 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) Sources/AdaptiveRefreshCore/AdaptiveRefreshPolicyCore.swift:14— Sources/AdaptiveRefreshCore/AdaptiveRefreshPolicyCore.swift:14-26 | Sources/AdaptiveReplayKit/ReplayPolicy.swift:32-44 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (13 lines × 2) Sources/CodexBar/IconRenderer.swift:373— Sources/CodexBar/IconRenderer.swift:373-385 | Sources/CodexBar/IconRenderer.swift:512-524 — 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 `Sources/CodexBar/IconRenderer.swift:373` 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, `Sources/CodexBar/IconRenderer.swift:367` calls `NSBezierPath`, `fill` and `Sources/CodexBar/IconRenderer.swift:508` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:260— Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:260-272 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:390-402 — before extracting anything, compare `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift` and `Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 172 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 `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:260` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) Sources/CodexBar/Menu/MenuCardView+Costs.swift:394— Sources/CodexBar/Menu/MenuCardView+Costs.swift:394-406 | Sources/CodexBarCore/CostUsageModels.swift:323-335 — 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 `Sources/CodexBar/Menu/MenuCardView+Costs.swift:394` 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) Sources/CodexBar/Menu/MenuDescriptor.swift:239— Sources/CodexBar/Menu/MenuDescriptor.swift:239-251 | Sources/CodexBarCLI/CLISessionsCommand.swift:87-99 — 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 (13 lines × 2) Sources/CodexBar/Providers/Devin/DevinProviderImplementation.swift:103— Sources/CodexBar/Providers/Devin/DevinProviderImplementation.swift:103-115 | Sources/CodexBar/Providers/Factory/FactoryProviderImplementation.swift:119-131 — 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 (13 lines × 2) Sources/CodexBarCLI/CLIConfigCommand.swift:224— Sources/CodexBarCLI/CLIConfigCommand.swift:224-236 | Sources/CodexBarCLI/CLIConfigCookieCommand.swift:70-82 — 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, `Sources/CodexBarCLI/CLIConfigCookieCommand.swift:83` calls `contains`, `CLIArgumentError` and `Sources/CodexBarCLI/CLIConfigCommand.swift:237` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) Sources/CodexBarCLI/CLIPayloads.swift:46— Sources/CodexBarCLI/CLIPayloads.swift:46-58 | Sources/CodexBarCLI/CLIPayloads.swift:77-89 — 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 `Sources/CodexBarCLI/CLIPayloads.swift:46` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) Sources/CodexBarCLI/CLIServeCommand.swift:399— Sources/CodexBarCLI/CLIServeCommand.swift:399-411 | Sources/CodexBarCLI/CLIServeCommand.swift:492-504 — 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 `Sources/CodexBarCLI/CLIServeCommand.swift:399` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) Sources/CodexBarCore/CookieHeaderCache.swift:678— Sources/CodexBarCore/CookieHeaderCache.swift:678-690 | Sources/CodexBarCore/CookieHeaderCache.swift:740-752 — 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) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:234— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:234-246 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:252-264 — 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 `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:234` 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 (13 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:270— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:270-282 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:196-208 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:270` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:184— Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:184-196 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:599-611 — 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 (13 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:376— Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:376-388 | Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:398-410 — 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) Sources/CodexBarCore/Providers/Codex/CodexCLISession.swift:91— Sources/CodexBarCore/Providers/Codex/CodexCLISession.swift:91-103 | Sources/CodexBarCore/Providers/Codex/CodexCLISession.swift:182-194 — 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 `Sources/CodexBarCore/Providers/Codex/CodexCLISession.swift:91` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:50— Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:50-62 | Sources/CodexBarCore/Providers/Perplexity/PerplexityCookieImporter.swift:90-102 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Sources/CodexBarCore/Providers/CommandCode/CommandCodeProviderDescriptor.swift:51— Sources/CodexBarCore/Providers/CommandCode/CommandCodeProviderDescriptor.swift:51-63 | Sources/CodexBarCore/Providers/Doubao/DoubaoProviderDescriptor.swift:65-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/CommandCode/CommandCodeProviderDescriptor.swift:51` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:430— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:430-442 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:451-463 — 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 `Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:430` 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 (13 lines × 2) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1272— Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1272-1284 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1341-1353 — 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 `Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1272` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1354` calls `setValue` and `Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1286` 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 (13 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:974— Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:974-986 | Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:989-1001 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) Sources/CodexBar/IconRenderer.swift:246— Sources/CodexBar/IconRenderer.swift:246-255 | Sources/CodexBar/IconRenderer.swift:347-356 — 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 `Sources/CodexBar/IconRenderer.swift:246` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) Sources/CodexBar/IconRenderer.swift:563— Sources/CodexBar/IconRenderer.swift:563-572 | Sources/CodexBar/IconRenderer.swift:576-585 — 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) Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:274— Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:274-283 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:404-413 — before extracting anything, compare `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift` and `Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 172 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 `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:98— Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:98-107 | Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:222-231 — 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 `Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:98` 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) Sources/CodexBar/Providers/Codex/CodexOwnershipContext.swift:59— Sources/CodexBar/Providers/Codex/CodexOwnershipContext.swift:59-68 | Sources/CodexBar/Providers/Codex/CodexOwnershipContext.swift:90-99 — 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 `Sources/CodexBar/Providers/Codex/CodexOwnershipContext.swift:59` 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 (10 lines × 2) Sources/CodexBar/Settings/SettingsStore+TokenAccounts.swift:300— Sources/CodexBar/Settings/SettingsStore+TokenAccounts.swift:300-309 | Sources/CodexBar/Settings/SettingsStore+TokenAccounts.swift:330-339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Sources/CodexBar/ShareStatsPayload.swift:287— Sources/CodexBar/ShareStatsPayload.swift:287-296 | Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:135-144 — 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 `Sources/CodexBar/ShareStatsPayload.swift:287` 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) Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:1150— Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:1150-1159 | Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:1170-1179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:1177— Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:1177-1186 | Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:1252-1261 — 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) Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:45— Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:45-54 | Sources/CodexBarCore/Providers/CodeRabbit/CodeRabbitProviderDescriptor.swift:32-41 — 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 `Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:45` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) Sources/CodexBarCore/Providers/Codebuff/CodebuffProviderDescriptor.swift:52— Sources/CodexBarCore/Providers/Codebuff/CodebuffProviderDescriptor.swift:52-61 | Sources/CodexBarCore/Providers/Wayfinder/WayfinderProviderDescriptor.swift:36-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Codebuff/CodebuffProviderDescriptor.swift:52` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:890— Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:890-899 | Sources/CodexBarCore/Providers/Warp/WarpUsageFetcher.swift:429-438 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift:45— Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift:45-54 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:37-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift:45` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) Sources/CodexBarCore/Providers/Grok/GrokCLISettingsFetcher.swift:26— Sources/CodexBarCore/Providers/Grok/GrokCLISettingsFetcher.swift:26-35 | Sources/CodexBarCore/Providers/Grok/GrokCreditsProxyFetcher.swift:23-32 — 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 `Sources/CodexBarCore/Providers/Grok/GrokCLISettingsFetcher.swift:26` 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) Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot+Metadata.swift:11— Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot+Metadata.swift:11-20 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot+Metadata.swift:28-37 — 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) Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot.swift:123— Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot.swift:123-132 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot.swift:152-161 — 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 `Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot.swift:123` 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 (10 lines × 2) Sources/CodexBarCore/Providers/Replicate/ReplicateWebFetchStrategy.swift:72— Sources/CodexBarCore/Providers/Replicate/ReplicateWebFetchStrategy.swift:72-81 | Sources/CodexBarCore/Providers/TypeSafe/TypeSafeWebFetchStrategy.swift:101-110 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Replicate/ReplicateWebFetchStrategy.swift:72` 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) Sources/CodexBarWidget/BurnDownWidgetViews.swift:116— Sources/CodexBarWidget/BurnDownWidgetViews.swift:116-125 | Sources/CodexBarWidget/CombinedBurnDownWidgetViews.swift:66-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodexBarWidget/BurnDownWidgetViews.swift:115` calls `VStack` and `Sources/CodexBarWidget/CombinedBurnDownWidgetViews.swift:65` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) Sources/CodexBarCore/Providers/Venice/VeniceSettingsReader.swift:7— Sources/CodexBarCore/Providers/Venice/VeniceSettingsReader.swift:7-16 | Sources/CodexBarCore/Providers/Warp/WarpSettingsReader.swift:9-18 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×17
Edited copy of a member (5 corresponding lines) Sources/CodexBarCore/CookieHeaderNormalizer.swift:58— Sources/CodexBarCore/CookieHeaderNormalizer.swift:58-62 | Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:453-458 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Scripts/cost_jsonl_shape_survey.swift:218— Scripts/cost_jsonl_shape_survey.swift:218-223 | Sources/CodexBarCore/CodexLocalProjectUsageProjection.swift:75-79 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBarCore/PiSessionCostScanner.swift:1003— Sources/CodexBarCore/PiSessionCostScanner.swift:1003-1010 | Sources/CodexBarCore/PiSessionCostScanner.swift:1012-1016 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBar/Menu/MenuBarDisplayText.swift:107— Sources/CodexBar/Menu/MenuBarDisplayText.swift:107-111 | Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:1340-1344 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBar/Providers/Ollama/OllamaUIErrorMapper.swift:32— Sources/CodexBar/Providers/Ollama/OllamaUIErrorMapper.swift:32-36 | Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:613-619 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBarCore/Providers/Cursor/CursorSandUsage.swift:61— Sources/CodexBarCore/Providers/Cursor/CursorSandUsage.swift:61-65 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:920-924 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCLIUsageFetcher.swift:148— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCLIUsageFetcher.swift:148-154 | Sources/CodexBarCore/Providers/Kimi/KimiDesktopSessionDiscovery.swift:87-91 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:48— Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:48-55 | Sources/CodexBar/StatusItem/StatusItemController+MenuTextRows.swift:39-43 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:559— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:559-563 | Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:656-660 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBar/Menu/MenuCardView+ProviderDetailLocalization.swift:162— Sources/CodexBar/Menu/MenuCardView+ProviderDetailLocalization.swift:162-166 | Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountProjection.swift:396-400 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBar/StatusItem/StatusItemController+MenuTracking.swift:540— Sources/CodexBar/StatusItem/StatusItemController+MenuTracking.swift:540-544 | Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift:623-627 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBar/TerminalApp.swift:140— Sources/CodexBar/TerminalApp.swift:140-144 | Sources/CodexBarCore/Providers/Codex/CodexStatusProbeIsolation.swift:41-45 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBarCore/Providers/Devin/DevinUsageSnapshot.swift:298— Sources/CodexBarCore/Providers/Devin/DevinUsageSnapshot.swift:298-302 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxSubscriptionMetadata.swift:220-224 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBar/ProviderRegistry.swift:202— Sources/CodexBar/ProviderRegistry.swift:202-208 | Sources/CodexBarCLI/TokenAccountCLI.swift:261-265 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBarCore/CookieHeaderCache.swift:823— Sources/CodexBarCore/CookieHeaderCache.swift:823-830 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:2506-2510 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBarCore/Providers/Doubao/DoubaoSettingsReader.swift:36— Sources/CodexBarCore/Providers/Doubao/DoubaoSettingsReader.swift:36-40 | Sources/CodexBarCore/Providers/Fireworks/FireworksSettingsReader.swift:18-24 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/CodexBarCore/CookieHeaderCache.swift:386— Sources/CodexBarCore/CookieHeaderCache.swift:386-390 | Sources/CodexBarCore/KeychainAccessPreflight.swift:187-193 — 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.
Duplicated block (12 lines × 2) Sources/CodexBar/HistoricalUsagePace.swift:141— Sources/CodexBar/HistoricalUsagePace.swift:141-152 | Sources/CodexBar/HistoricalUsagePace.swift:268-279 — 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 `Sources/CodexBar/HistoricalUsagePace.swift:141` 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 (12 lines × 2) Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:460— Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:460-471 | Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:1094-1105 — 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 `Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:460` 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) Sources/CodexBarCLI/CLIServeCommand.swift:903— Sources/CodexBarCLI/CLIServeCommand.swift:903-914 | Sources/CodexBarCLI/CLIServeCommand.swift:942-953 — 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 `Sources/CodexBarCLI/CLIServeCommand.swift:903` 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 (12 lines × 2) Sources/CodexBarCore/CostUsageFetcher.swift:456— Sources/CodexBarCore/CostUsageFetcher.swift:456-467 | Sources/CodexBarCore/CostUsageFetcher.swift:501-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) Sources/CodexBarCore/PiFamilySessionScanner.swift:1011— Sources/CodexBarCore/PiFamilySessionScanner.swift:1011-1022 | Sources/CodexBarCore/PiFamilySessionScanner.swift:1023-1034 — 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 `Sources/CodexBarCore/PiFamilySessionScanner.swift:1011` 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 (12 lines × 2) Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:258— Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:258-269 | Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:714-725 — 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 `Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:258` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:255— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:255-266 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:181-192 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:255` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1084— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1084-1095 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleJSON.swift:217-228 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:372— Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:372-383 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:736-747 — 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 `Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:372` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Sources/CodexBarCore/Providers/Grok/GrokRPCClient.swift:146— Sources/CodexBarCore/Providers/Grok/GrokRPCClient.swift:146-157 | Sources/CodexBarCore/UsageFetcher.swift:1130-1141 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:190— Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:190-201 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift:267-278 — 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 `Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:190` 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 (12 lines × 2) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:496— Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:496-507 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:816-827 — 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 `Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:496` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:691— Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:691-702 | Sources/CodexBarCore/Providers/Shared/OpenCodeSubscriptionParser.swift:161-172 — 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 `Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:691` 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 (12 lines × 2) Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:42— Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:42-53 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieHeaders.swift:94-105 — before extracting anything, compare `Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift` and `Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieHeaders.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:42` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:413— Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:413-424 | Sources/CodexBarCore/CostUsageModels.swift:354-365 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1414— Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1414-1425 | Sources/CodexBarCore/Providers/Mistral/MistralModels.swift:526-537 — 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 `Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1414` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1413` calls `bucketCalendar` and `Sources/CodexBarCore/Providers/Mistral/MistralModels.swift:525` 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· Edited copy of a member (14 corresponding lines) · ×15
Edited copy of a member (14 corresponding lines) Sources/CodexBarCore/CodexManagedAccounts.swift:71— Sources/CodexBarCore/CodexManagedAccounts.swift:71-84 | Sources/CodexBarCore/TokenAccounts.swift:75-90 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:55— Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:55-69 | Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:71-84 — 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) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:599— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:599-612 | Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:614-627 — 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) Sources/CodexBarWidget/CodexBarWidgetViews.swift:45— Sources/CodexBarWidget/CodexBarWidgetViews.swift:45-58 | Sources/CodexBarWidget/CodexBarWidgetViews.swift:64-77 — 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) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:319— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:319-332 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:90-105 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:184— Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:184-197 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift:196-211 — 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) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:372— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:372-388 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudTokenPlanAPIClient.swift:57-70 — 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) Sources/CodexBar/AgentSessionsStore.swift:369— Sources/CodexBar/AgentSessionsStore.swift:369-382 | Sources/CodexBar/AgentSessionsStore.swift:406-427 — 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) Sources/CodexBarCore/Providers/ProviderVersionDetector.swift:226— Sources/CodexBarCore/Providers/ProviderVersionDetector.swift:226-239 | Sources/CodexBarCore/Providers/ProviderVersionDetector.swift:241-255 — 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) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:517— Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:517-530 | Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:532-545 — 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) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:244— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:244-257 | Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:259-272 — 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) Sources/CodexBar/PlanUtilizationHistoryStore.swift:403— Sources/CodexBar/PlanUtilizationHistoryStore.swift:403-416 | Sources/CodexBar/PlanUtilizationHistoryStore.swift:421-434 — 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) Sources/CodexBarCore/Providers/Codex/CodexAccountPromotionPreparation.swift:289— Sources/CodexBarCore/Providers/Codex/CodexAccountPromotionPreparation.swift:289-306 | Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthCredentials.swift:465-478 — 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) Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:80— Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:80-93 | Sources/CodexBarCore/Providers/Grok/GrokProviderDescriptor.swift:122-142 — 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) Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:1091— Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:1091-1104 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoZenBalanceParser.swift:153-169 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×14
Edited copy of a member (12 corresponding lines) Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift:525— Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift:525-536 | Sources/CodexBarCore/UsageFetcher.swift:62-74 — 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) Sources/CodexBarCore/CreditsModels.swift:97— Sources/CodexBarCore/CreditsModels.swift:97-108 | Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift:195-207 — 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) Sources/CodexBarCore/CostUsageModels.swift:1346— Sources/CodexBarCore/CostUsageModels.swift:1346-1357 | Sources/CodexBarCore/CostUsageModels.swift:1415-1427 — 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) Sources/CodexBar/HistoricalUsagePace.swift:673— Sources/CodexBar/HistoricalUsagePace.swift:673-684 | Sources/CodexBarCore/CostUsageModels.swift:1600-1611 — 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) Sources/CodexBarWidget/BurnDownWidgetProvider.swift:515— Sources/CodexBarWidget/BurnDownWidgetProvider.swift:515-527 | Sources/CodexBarWidget/BurnDownWidgetProvider.swift:549-560 — 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) Sources/CodexBarCore/Providers/MiniMax/MiniMaxBillingHistory.swift:323— Sources/CodexBarCore/Providers/MiniMax/MiniMaxBillingHistory.swift:323-337 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxBillingHistory.swift:339-350 — 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) Sources/CodexBar/HistoricalUsagePace.swift:579— Sources/CodexBar/HistoricalUsagePace.swift:579-590 | Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:1472-1485 — 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) Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe+ResponseModels.swift:99— Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe+ResponseModels.swift:99-110 | Sources/CodexBarCore/Providers/IBMBob/IBMBobUsageFetcher.swift:150-161 — 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) Sources/CodexBar/UsageStore/UsageStore+SpendDashboardTokenCost.swift:19— Sources/CodexBar/UsageStore/UsageStore+SpendDashboardTokenCost.swift:19-30 | Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift:247-258 — 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) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:675— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:675-690 | Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:394-405 — 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) Sources/CodexBarCLI/CLIServeCommand.swift:832— Sources/CodexBarCLI/CLIServeCommand.swift:832-843 | Sources/CodexBarCLI/CLIServeCommand.swift:845-856 — 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) Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageFetcher.swift:304— Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageFetcher.swift:304-316 | Sources/CodexBarCore/Providers/CommandCode/CommandCodeUsageFetcher.swift:384-395 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1740— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1740-1751 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1755-1768 — 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) Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:596— Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:596-613 | Sources/CodexBar/StatusItem/StatusItemController+MenuBarLayout.swift:223-234 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×13
Edited copy of a member (19 corresponding lines) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher+SessionAuthorization.swift:89— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher+SessionAuthorization.swift:89-107 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher+SessionAuthorization.swift:109-129 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/CodexBarCore/Providers/Replicate/ReplicateWebFetchStrategy.swift:27— Sources/CodexBarCore/Providers/Replicate/ReplicateWebFetchStrategy.swift:27-45 | Sources/CodexBarCore/Providers/TypeSafe/TypeSafeWebFetchStrategy.swift:30-60 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:110— Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:110-128 | Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:130-151 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/CodexBarCore/Providers/Codex/CodexPAT/CodexPATUsageFetcher.swift:56— Sources/CodexBarCore/Providers/Codex/CodexPAT/CodexPATUsageFetcher.swift:56-74 | Sources/CodexBarCore/Providers/Codex/CodexPAT/CodexPATUsageFetcher.swift:76-99 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe+AppAuth.swift:20— Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe+AppAuth.swift:20-38 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:809-829 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:851— Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:851-871 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:873-891 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/CodexBarCore/Providers/Windsurf/WindsurfWebFetcher.swift:459— Sources/CodexBarCore/Providers/Windsurf/WindsurfWebFetcher.swift:459-478 | Sources/CodexBarCore/Providers/Windsurf/WindsurfWebFetcher.swift:499-517 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/CodexBarCore/Providers/ProviderFetchPlan.swift:192— Sources/CodexBarCore/Providers/ProviderFetchPlan.swift:192-211 | Sources/CodexBarCore/Providers/ProviderFetchPlan.swift:214-232 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/CodexBarCLI/CLIRenderer.swift:533— Sources/CodexBarCLI/CLIRenderer.swift:533-551 | Sources/CodexBarCLI/CLIRenderer.swift:620-638 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/CodexBarCore/AgentSession.swift:83— Sources/CodexBarCore/AgentSession.swift:83-103 | Sources/CodexBarCore/Providers/Muse/MuseLocalUsageCache.swift:25-43 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/CodexBar/UsageStore/UsageStore+Hooks.swift:259— Sources/CodexBar/UsageStore/UsageStore+Hooks.swift:259-281 | Sources/CodexBarCLI/CLIHooksWatchCommand.swift:250-268 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/CodexBarCore/CopilotUsageModels.swift:75— Sources/CodexBarCore/CopilotUsageModels.swift:75-93 | Sources/CodexBarCore/CopilotUsageModels.swift:128-148 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/CodexBar/Menu/MenuCardView.swift:141— Sources/CodexBar/Menu/MenuCardView.swift:141-159 | Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:71-89 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×13
Edited copy of a member (16 corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:342— Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:342-357 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:359-386 — 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) Sources/CodexBarCore/Config/CodexBarConfigValidation.swift:241— Sources/CodexBarCore/Config/CodexBarConfigValidation.swift:241-256 | Sources/CodexBarCore/Config/CodexBarConfigValidation.swift:308-323 — 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) Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot+Metadata.swift:25— Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot+Metadata.swift:25-40 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot.swift:97-112 — 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) Sources/CodexBarCLI/CLIConfigCommand.swift:223— Sources/CodexBarCLI/CLIConfigCommand.swift:223-238 | Sources/CodexBarCLI/CLIConfigCookieCommand.swift:69-87 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudePlan.swift:79— Sources/CodexBarCore/Providers/Claude/ClaudePlan.swift:79-100 | Sources/CodexBarCore/Providers/Claude/ClaudePlan.swift:152-167 — 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) Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:524— Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:524-539 | Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:541-556 — 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) Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:40— Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:40-55 | Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:57-72 — 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) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:330— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:330-347 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:596-611 — 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) Sources/CodexBarCore/Providers/OpenCode/OpenCodeConsoleUsageFetcher.swift:8— Sources/CodexBarCore/Providers/OpenCode/OpenCodeConsoleUsageFetcher.swift:8-23 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:431-446 — 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) Sources/CodexBar/StatusItem/StatusItemController+FleetAccounts.swift:6— Sources/CodexBar/StatusItem/StatusItemController+FleetAccounts.swift:6-21 | Sources/CodexBar/StatusItem/StatusItemController.swift:631-646 — 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) Sources/CodexBarCore/Sync/SyncModels.swift:214— Sources/CodexBarCore/Sync/SyncModels.swift:214-229 | Sources/CodexBarCore/Sync/SyncModels.swift:231-247 — 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) Sources/CodexBar/Providers/Codex/CodexAccountUsageSnapshotStore.swift:13— Sources/CodexBar/Providers/Codex/CodexAccountUsageSnapshotStore.swift:13-28 | Sources/CodexBar/UsageStore/UsageStore+TokenAccountCacheKey.swift:14-29 — 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) Sources/CodexBarCore/PiSessionCostScanner.swift:138— Sources/CodexBarCore/PiSessionCostScanner.swift:138-153 | Sources/CodexBarCore/PiSessionCostScanner.swift:326-341 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×12
Edited copy of a member (20 corresponding lines) Sources/CodexBarCore/Providers/Shared/CurlCaptureParser.swift:10— Sources/CodexBarCore/Providers/Shared/CurlCaptureParser.swift:10-32 | Sources/CodexBarCore/Providers/Shared/CurlCaptureParser.swift:36-55 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageFetcher.swift:243— Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageFetcher.swift:243-264 | Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageFetcher.swift:266-285 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:296— Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:296-315 | Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:317-349 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift:52— Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift:52-77 | Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift:108-127 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:423— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:423-442 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:444-463 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1074— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1074-1098 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleJSON.swift:211-230 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/CodexBar/Providers/Codex/CodexLoginRunner.swift:5— Sources/CodexBar/Providers/Codex/CodexLoginRunner.swift:5-24 | Sources/CodexBar/Providers/Kiro/KiroLoginRunner.swift:5-24 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) REDACTED:243— REDACTED:243-262 | REDACTED:264-293 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:150— Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:150-169 | Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:219-241 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/CodexBarCore/Providers/Codex/CodexCLIDashboardAuthorityContext.swift:4— Sources/CodexBarCore/Providers/Codex/CodexCLIDashboardAuthorityContext.swift:4-23 | Sources/CodexBarCore/Providers/Codex/CodexCLIDashboardAuthorityContext.swift:25-49 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:1312— Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:1312-1331 | Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:1333-1352 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:849— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:849-868 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:888-907 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×11
Edited copy of a member (17 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:756— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:756-772 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1100-1116 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:286— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:286-304 | Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:306-322 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift:185— Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift:185-201 | Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift:235-261 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/CodexBar/Menu/MenuCardView.swift:1135— Sources/CodexBar/Menu/MenuCardView.swift:1135-1151 | Sources/CodexBar/Menu/MenuDescriptor.swift:515-531 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/CodexBarCore/Providers/Codex/CodexPAT/CodexPATFetchStrategy.swift:136— Sources/CodexBarCore/Providers/Codex/CodexPAT/CodexPATFetchStrategy.swift:136-152 | Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift:531-549 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/CodexBarCLI/CLIHelpers.swift:221— Sources/CodexBarCLI/CLIHelpers.swift:221-244 | Sources/CodexBarCLI/CLIHelpers.swift:268-284 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:1023— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:1023-1041 | Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:827-843 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:1023— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:1023-1041 | Sources/CodexBarCore/CostUsageModels.swift:1265-1281 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/CodexBarWidget/BurnDownWidgetViews.swift:11— Sources/CodexBarWidget/BurnDownWidgetViews.swift:11-32 | Sources/CodexBarWidget/CombinedBurnDownWidgetViews.swift:11-27 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/CodexBarCore/CostUsageModels.swift:784— Sources/CodexBarCore/CostUsageModels.swift:784-800 | Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:15-31 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthCredentials.swift:31— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthCredentials.swift:31-49 | Sources/CodexBarCore/Providers/VertexAI/VertexAIOAuth/VertexAIOAuthCredentials.swift:12-28 — 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 (18 corresponding lines) · ×11
Edited copy of a member (18 corresponding lines) Sources/CodexBarCore/CostUsageModels.swift:535— Sources/CodexBarCore/CostUsageModels.swift:535-552 | Sources/CodexBarCore/CostUsageModels.swift:721-738 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:1236— Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:1236-1253 | Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:1270-1287 — 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) Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:50— Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:50-67 | Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:69-86 — 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) Sources/CodexBarCore/CostUsageModels.swift:381— Sources/CodexBarCore/CostUsageModels.swift:381-402 | Sources/CodexBarCore/CostUsageModels.swift:413-430 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:85— Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:85-102 | Sources/CodexBarCore/Providers/HuggingFace/HuggingFaceProviderDescriptor.swift:75-94 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountReader.swift:102— Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountReader.swift:102-122 | Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountReader.swift:126-143 — 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) Sources/CodexBar/Providers/Codex/CodexOwnershipContext.swift:108— Sources/CodexBar/Providers/Codex/CodexOwnershipContext.swift:108-125 | Sources/CodexBar/Providers/Codex/CodexOwnershipContext.swift:127-148 — 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) Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:1134— Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:1134-1152 | Sources/CodexBarCore/Providers/Warp/WarpUsageFetcher.swift:357-374 — 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) Sources/CodexBarCore/Providers/VertexAI/VertexAIOAuth/VertexAIOAuthCredentials.swift:67— Sources/CodexBarCore/Providers/VertexAI/VertexAIOAuth/VertexAIOAuthCredentials.swift:67-90 | Sources/CodexBarCore/Providers/VertexAI/VertexAIOAuth/VertexAIOAuthCredentials.swift:92-109 — 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) Sources/CodexBarCore/BrowserDetection.swift:97— Sources/CodexBarCore/BrowserDetection.swift:97-117 | Sources/CodexBarCore/BrowserDetection.swift:123-140 — 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) Sources/CodexBar/DockIconController.swift:163— Sources/CodexBar/DockIconController.swift:163-186 | Sources/CodexBar/Settings/PlaceholderSettingsWindowGuard.swift:50-67 — 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.
fetchUsage::parseQuota (cognitive 37) REDACTED:241— fetchUsage::parseQuota has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 9, ternaries 3 (5 pts), other 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.
fetchUsage::accounts (cognitive 36) REDACTED:38— fetchUsage::accounts has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 8, loops 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage::pages (cognitive 35) Sources/CodexBarCore/Resources/Plugins/openai.js:77— fetchUsage::pages has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (18 pts), ternaries 2 (8 pts), boolean chains 6, loops 2 (3 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.
fetchUsage::summary (cognitive 30) REDACTED:82— fetchUsage::summary has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 11, loops 1, ternaries 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.
fetchUsage::cookies (cognitive 26) Sources/CodexBarCore/Resources/Plugins/perplexity.js:18— fetchUsage::cookies has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (4 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.
fetchUsage::parse (cognitive 22) Sources/CodexBarCore/Resources/Plugins/qoder.js:32— fetchUsage::parse has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 6, if/else 5, ternaries 4 (5 pts), other 4, error handling 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.
fetchUsage::parseLimit (cognitive 22) Sources/CodexBarCore/Resources/Plugins/zai.js:72— fetchUsage::parseLimit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, ternaries 3 (5 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage::validate (cognitive 20) REDACTED:38— fetchUsage::validate has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 2 (6 pts), boolean chains 4, 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.
fetchUsage::window (cognitive 18) Sources/CodexBarCore/Resources/Plugins/zai.js:104— fetchUsage::window has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage::discover (cognitive 17) REDACTED:54— fetchUsage::discover has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (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.
Duplicated block (14 lines × 2) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:1028— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:1028-1041 | Sources/CodexBarCore/CostUsageModels.swift:1268-1281 — 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 `Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:1028` 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) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1163— Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1163-1176 | Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1595-1608 — 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 `Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1163` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:42— Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:42-55 | Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:59-72 — 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 `Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:42` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) Sources/CodexBarCore/CostUsageFetcher.swift:1990— Sources/CodexBarCore/CostUsageFetcher.swift:1990-2003 | Sources/CodexBarCore/CostUsageFetcher.swift:2019-2032 — 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 `Sources/CodexBarCore/CostUsageFetcher.swift:1990` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1666— Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1666-1679 | Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1694-1707 — 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 `Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1666` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:619— Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:619-632 | Sources/CodexBarCore/Providers/Codex/CodexCLISession.swift:352-365 — 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 (14 lines × 2) Sources/CodexBarCore/Providers/Codex/CodexDashboardAuthority.swift:237— Sources/CodexBarCore/Providers/Codex/CodexDashboardAuthority.swift:237-250 | Sources/CodexBarCore/Providers/Codex/CodexDashboardAuthority.swift:261-274 — 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 `Sources/CodexBarCore/Providers/Codex/CodexDashboardAuthority.swift:237` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:476— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:476-489 | Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:504-517 — 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 `Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift: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.
Duplicated block (14 lines × 2) Sources/CodexBarCore/Providers/Grok/GrokCreditsProxyFetcher.swift:29— Sources/CodexBarCore/Providers/Grok/GrokCreditsProxyFetcher.swift:29-42 | Sources/CodexBarCore/Providers/Grok/GrokWebBillingFetcher.swift:270-283 — 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) Sources/CodexBarCore/WidgetSnapshot.swift:38— Sources/CodexBarCore/WidgetSnapshot.swift:38-51 | Sources/CodexBarCore/WidgetSnapshot.swift:70-83 — 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 `Sources/CodexBarCore/WidgetSnapshot.swift:38` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×9
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:539— Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:539-652 | Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:654-717 | Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:719-781 | Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:783-837 — 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) Sources/CodexBarCLI/CLIConfigClearCredentialCommand.swift:11— Sources/CodexBarCLI/CLIConfigClearCredentialCommand.swift:11-56 | Sources/CodexBarCLI/CLIConfigCommand.swift:100-138 | Sources/CodexBarCLI/CLIConfigCommand.swift:149-221 | Sources/CodexBarCLI/CLIHooksCommand.swift:75-150 — 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) Sources/CodexBarCLI/CLIRenderer.swift:168— Sources/CodexBarCLI/CLIRenderer.swift:168-177 | Sources/CodexBarCLI/CLIRenderer.swift:208-230 | Sources/CodexBarCLI/CLIRenderer.swift:232-254 | Sources/CodexBarCLI/CLIRenderer.swift:309-320 — 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) Sources/CodexBarCore/Config/SettingsValue.swift:8— Sources/CodexBarCore/Config/SettingsValue.swift:8-19 | Sources/CodexBarCore/Providers/HuggingFace/HuggingFaceSettingsReader.swift:64-75 | Sources/CodexBarCore/Providers/IBMBob/IBMBobSettingsReader.swift:6-22 | Sources/CodexBarCore/Providers/Nous/NousSettingsReader.swift:278-284 — 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) Sources/CodexBarCore/CostUsageFetcher.swift:207— Sources/CodexBarCore/CostUsageFetcher.swift:207-242 | Sources/CodexBarCore/CostUsageFetcher.swift:244-294 | Sources/CodexBarCore/CostUsageFetcher.swift:448-490 | Sources/CodexBarCore/CostUsageFetcher.swift:493-877 — 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) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:774— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:774-787 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1167-1180 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageParser.swift:177-195 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleSECTokenResolver.swift:153-166 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeScopedWeeklyLimitMapper.swift:49— Sources/CodexBarCore/Providers/Claude/ClaudeScopedWeeklyLimitMapper.swift:49-62 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:540-553 | Sources/CodexBarCore/Providers/Codex/CodexAdditionalRateLimitMapper.swift:139-152 | Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:743-756 — 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) Sources/CodexBarCore/Providers/Grok/GrokCLISettingsFetcher.swift:19— Sources/CodexBarCore/Providers/Grok/GrokCLISettingsFetcher.swift:19-46 | Sources/CodexBarCore/Providers/Grok/GrokCreditsProxyFetcher.swift:14-44 | Sources/CodexBarCore/Providers/Grok/GrokRemainingResetsFetcher.swift:317-356 | Sources/CodexBarCore/Providers/Grok/GrokWebBillingFetcher.swift:248-289 — 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) Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:42— Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:42-54 | Sources/CodexBarCore/Providers/Mistral/MistralCookieImporter.swift:48-78 | Sources/CodexBarCore/Providers/Replicate/ReplicateCookieImporter.swift:22-43 | Sources/CodexBarCore/Providers/Venice/VeniceCookieImporter.swift:20-32 — 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 (22 corresponding lines) · ×9
Edited copy of a member (22 corresponding lines) Sources/CodexBarCore/CostUsageModels.swift:478— Sources/CodexBarCore/CostUsageModels.swift:478-499 | Sources/CodexBarCore/CostUsageModels.swift:658-685 — 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) Sources/CodexBar/SessionQuotaNotifications.swift:570— Sources/CodexBar/SessionQuotaNotifications.swift:570-601 | Sources/CodexBar/SessionQuotaNotifications.swift:603-624 — 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) Sources/CodexBar/Menu/MenuCardView+Costs.swift:383— Sources/CodexBar/Menu/MenuCardView+Costs.swift:383-406 | Sources/CodexBarCore/CostUsageModels.swift:314-335 — 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) Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:50— Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:50-72 | Sources/CodexBarCore/Providers/Perplexity/PerplexityCookieImporter.swift:90-111 — 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) Sources/CodexBar/Settings/SettingsStore+Config.swift:223— Sources/CodexBar/Settings/SettingsStore+Config.swift:223-244 | Sources/CodexBar/Settings/SettingsStore+Config.swift:265-287 — 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) Sources/CodexBarCLI/CLIServeOperationCoordinator.swift:421— Sources/CodexBarCLI/CLIServeOperationCoordinator.swift:421-442 | Sources/CodexBarCLI/CLIServeOperationCoordinator.swift:444-466 — 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) Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:541— Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:541-562 | Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:343-365 — 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) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekPlatformTokenImporter.swift:439— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekPlatformTokenImporter.swift:439-460 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekPlatformTokenImporter.swift:462-483 — 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) Sources/CodexBar/Settings/PreferencesProvidersPane.swift:32— Sources/CodexBar/Settings/PreferencesProvidersPane.swift:32-53 | Sources/CodexBar/Settings/PreferencesView.swift:75-97 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×9
Edited copy of a member (21 corresponding lines) Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:127— Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:127-147 | Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:194-216 — 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) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1027— Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1027-1049 | Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1051-1071 — 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) Sources/CodexBarCLI/CLIIO.swift:94— Sources/CodexBarCLI/CLIIO.swift:94-115 | Sources/CodexBarCore/PathEnvironment.swift:1332-1352 — 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) Sources/CodexBarCore/Providers/Codex/CodexSpendControlLimitMapping.swift:4— Sources/CodexBarCore/Providers/Codex/CodexSpendControlLimitMapping.swift:4-24 | Sources/CodexBarCore/UsageFetcher.swift:1430-1455 — 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) Sources/CodexBarCore/AppGroupSupport.swift:219— Sources/CodexBarCore/AppGroupSupport.swift:219-246 | Sources/CodexBarCore/KeychainCacheStore+ApplicationPaths.swift:100-120 — 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) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:1019— Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:1019-1043 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:1063-1083 — 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) Sources/CodexBarCore/CreditsModels.swift:236— Sources/CodexBarCore/CreditsModels.swift:236-256 | Sources/CodexBarCore/CreditsModels.swift:303-324 — 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) Sources/CodexBarCore/CostUsageSessionTurn.swift:15— Sources/CodexBarCore/CostUsageSessionTurn.swift:15-35 | Sources/CodexBarCore/CostUsageSessionTurn.swift:57-81 — 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) Sources/CodexBar/UsageStore/UsageStore+HistoricalPace.swift:69— Sources/CodexBar/UsageStore/UsageStore+HistoricalPace.swift:69-90 | Sources/CodexBar/UsageStore/UsageStore+HistoricalPace.swift:93-113 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×9
Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodexBarCore/Providers/Factory/FactoryLocalStorageImporter.swift:329— Sources/CodexBarCore/Providers/Factory/FactoryLocalStorageImporter.swift:329-337 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:408-418 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:555-564 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:38— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:38-47 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:93-102 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:61-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:313— Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:313-325 | Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:327-338 | Sources/CodexBarCore/Providers/Kimi/KimiSettingsReader.swift:181-189 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:520— Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:520-528 | Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:565-573 | Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:772-780 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:35— Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:35-43 | Sources/CodexBarCore/Providers/Codex/CodexAccountReconciliation.swift:191-202 | Sources/CodexBarCore/Providers/Codex/CodexAccountReconciliation.swift:424-432 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:776— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:776-784 | Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:203-212 | Sources/CodexBarCore/UsageFetcher.swift:1362-1370 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodexBarCore/CodexHomeScope.swift:42— Sources/CodexBarCore/CodexHomeScope.swift:42-52 | Sources/CodexBarCore/Providers/Antigravity/AntigravityOfflineStore.swift:10-18 | Sources/CodexBarCore/Providers/OpenCode/OpenCodeLocalHistoryAdapter.swift:852-870 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:795— Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:795-804 | Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:806-814 | Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:825-838 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodexBarCore/KeychainSecurity.swift:158— Sources/CodexBarCore/KeychainSecurity.swift:158-166 | Sources/CodexBarCore/KeychainSecurity.swift:168-179 | Sources/CodexBarCore/KeychainSecurity.swift:181-189 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Change-coupling hub: CursorProviderImplementation.swift → ClaudeProviderImplementation.swift, CodexProviderImplementation.swift, FactoryProviderImplementation.swift, MiniMaxProviderImplementation.swift, OpenCodeProviderImplementation.swift Sources/CodexBar/Providers/Cursor/CursorProviderImplementation.swift— `Sources/CodexBar/Providers/Cursor/CursorProviderImplementation.swift` changes together with 5 other files — `Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift`, `Sources/CodexBar/Providers/Codex/CodexProviderImplementation.swift`, `Sources/CodexBar/Providers/Factory/FactoryProviderImplementation.swift`, `Sources/CodexBar/Providers/MiniMax/MiniMaxProviderImplementation.swift`, `Sources/CodexBar/Providers/OpenCode/OpenCodeProviderImplementation.swift` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
Change-coupling hub: LogCategories.swift → ProviderDescriptor.swift, CodexBarWidgetProvider.swift, CodexBarWidgetViews.swift Sources/CodexBarCore/Logging/LogCategories.swift— `Sources/CodexBarCore/Logging/LogCategories.swift` changes together with 3 other files — `Sources/CodexBarCore/Providers/ProviderDescriptor.swift`, `Sources/CodexBarWidget/CodexBarWidgetProvider.swift`, `Sources/CodexBarWidget/CodexBarWidgetViews.swift` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: StatusItemController+Menu.swift → StatusItemController+HostedSubmenus.swift, StatusItemController+MenuCardItems.swift, StatusItemController+MenuReconcile.swift, StatusItemController+MenuRefreshScheduling.swift, StatusItemController+ProviderSwitcher.swift, StatusItemController+UsageHistoryMenu.swift, VertexAIProviderDescriptor.swift Sources/CodexBar/StatusItem/StatusItemController+Menu.swift— `Sources/CodexBar/StatusItem/StatusItemController+Menu.swift` changes together with 7 other files — `Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift`, `Sources/CodexBar/StatusItem/StatusItemController+MenuCardItems.swift`, `Sources/CodexBar/StatusItem/StatusItemController+MenuReconcile.swift`, `Sources/CodexBar/StatusItem/StatusItemController+MenuRefreshScheduling.swift`, `Sources/CodexBar/StatusItem/StatusItemController+ProviderSwitcher.swift`, `Sources/CodexBar/StatusItem/StatusItemController+UsageHistoryMenu.swift`, `Sources/CodexBarCore/Providers/VertexAI/VertexAIProviderDescriptor.swift` — none of which declares a dependency on it: one file is the hub of 7 separate couplings, not 7 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 7.
Change-coupling hub: StatusItemController+Animation.swift → StatusItemController+CountdownRefresh.swift, StatusItemController+IconObservation.swift, StatusItemController+SwitcherMetrics.swift Sources/CodexBar/StatusItem/StatusItemController+Animation.swift— `Sources/CodexBar/StatusItem/StatusItemController+Animation.swift` changes together with 3 other files — `Sources/CodexBar/StatusItem/StatusItemController+CountdownRefresh.swift`, `Sources/CodexBar/StatusItem/StatusItemController+IconObservation.swift`, `Sources/CodexBar/StatusItem/StatusItemController+SwitcherMetrics.swift` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: AugmentProviderImplementation.swift → ProviderRegistry.swift, ClaudeProviderImplementation.swift, CodexProviderImplementation.swift, CursorProviderImplementation.swift, FactoryProviderImplementation.swift, MiniMaxProviderImplementation.swift, OpenCodeProviderImplementation.swift Sources/CodexBar/Providers/Augment/AugmentProviderImplementation.swift— `Sources/CodexBar/Providers/Augment/AugmentProviderImplementation.swift` changes together with 7 other files — `Sources/CodexBar/ProviderRegistry.swift`, `Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift`, `Sources/CodexBar/Providers/Codex/CodexProviderImplementation.swift`, `Sources/CodexBar/Providers/Cursor/CursorProviderImplementation.swift`, `Sources/CodexBar/Providers/Factory/FactoryProviderImplementation.swift`, `Sources/CodexBar/Providers/MiniMax/MiniMaxProviderImplementation.swift`, `Sources/CodexBar/Providers/OpenCode/OpenCodeProviderImplementation.swift` — none of which declares a dependency on it: one file is the hub of 7 separate couplings, not 7 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 7.
Change-coupling hub: FactoryProviderImplementation.swift → ClaudeProviderImplementation.swift, CodexProviderImplementation.swift, MiniMaxProviderImplementation.swift Sources/CodexBar/Providers/Factory/FactoryProviderImplementation.swift— `Sources/CodexBar/Providers/Factory/FactoryProviderImplementation.swift` changes together with 3 other files — `Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift`, `Sources/CodexBar/Providers/Codex/CodexProviderImplementation.swift`, `Sources/CodexBar/Providers/MiniMax/MiniMaxProviderImplementation.swift` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: UsageStore.swift → KeychainPromptCoordinator.swift, ProviderConfigEnvironment.swift, AugmentSessionKeepalive.swift, VertexAIProviderDescriptor.swift, CodexBarWidgetProvider.swift, CodexBarWidgetViews.swift Sources/CodexBar/UsageStore/UsageStore.swift— `Sources/CodexBar/UsageStore/UsageStore.swift` changes together with 6 other files — `Sources/CodexBar/KeychainPromptCoordinator.swift`, `Sources/CodexBarCore/Config/ProviderConfigEnvironment.swift`, `Sources/CodexBarCore/Providers/Augment/AugmentSessionKeepalive.swift`, `Sources/CodexBarCore/Providers/VertexAI/VertexAIProviderDescriptor.swift`, `Sources/CodexBarWidget/CodexBarWidgetProvider.swift`, `Sources/CodexBarWidget/CodexBarWidgetViews.swift` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
Change-coupling hub: ProviderConfigEnvironment.swift → CodexBarConfigValidation.swift, ProviderTokenResolver.swift, CodexBarWidgetProvider.swift, CodexBarWidgetViews.swift Sources/CodexBarCore/Config/ProviderConfigEnvironment.swift— `Sources/CodexBarCore/Config/ProviderConfigEnvironment.swift` changes together with 4 other files — `Sources/CodexBarCore/Config/CodexBarConfigValidation.swift`, `Sources/CodexBarCore/Providers/ProviderTokenResolver.swift`, `Sources/CodexBarWidget/CodexBarWidgetProvider.swift`, `Sources/CodexBarWidget/CodexBarWidgetViews.swift` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×8
Edited copy of a member (33 corresponding lines) Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:144— Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:144-182 | Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:212-244 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:105— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:105-137 | Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:139-186 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) Sources/CodexBar/ShareStatsCardView.swift:221— Sources/CodexBar/ShareStatsCardView.swift:221-253 | Sources/CodexBar/ShareStatsCardView.swift:268-303 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) Sources/CodexBarCLI/CLIConfigCookieCommand.swift:6— Sources/CodexBarCLI/CLIConfigCookieCommand.swift:6-44 | Sources/CodexBarCLI/CLIConfigSourceCommand.swift:6-38 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) Sources/CodexBar/Menu/MenuBarLayout.swift:1309— Sources/CodexBar/Menu/MenuBarLayout.swift:1309-1341 | Sources/CodexBar/Menu/MenuBarLayout.swift:1515-1547 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:183— Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:183-216 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:475-507 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) Sources/CodexBarCore/CostUsageModels.swift:501— Sources/CodexBarCore/CostUsageModels.swift:501-533 | Sources/CodexBarCore/Hooks/HookEvent.swift:62-98 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) Sources/CodexBarCore/CostUsageModels.swift:687— Sources/CodexBarCore/CostUsageModels.swift:687-719 | Sources/CodexBarCore/CostUsageSessionBreakdown.swift:34-70 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×8
Edited copy of a member (23 corresponding lines) Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:37— Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:37-60 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieHeaders.swift:90-112 — 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) Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift:331— Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift:331-355 | Sources/CodexBarCore/Providers/Devin/DevinAppSessionImporter.swift:255-277 — 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) Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:65— Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:65-87 | Sources/CodexBarCore/Providers/Venice/VeniceCookieImporter.swift:43-66 — 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) Sources/CodexBar/CookieHeaderStore.swift:37— Sources/CodexBar/CookieHeaderStore.swift:37-59 | Sources/CodexBar/Providers/Zai/ZaiTokenStore.swift:24-50 — 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) Sources/CodexBarCLI/CLICostCommand.swift:1094— Sources/CodexBarCLI/CLICostCommand.swift:1094-1118 | Sources/CodexBarCLI/CLICostCommand.swift:1225-1247 — 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) Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:390— Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:390-415 | Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:425-447 — 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) Sources/CodexBarCore/CodexManagedAccounts.swift:16— Sources/CodexBarCore/CodexManagedAccounts.swift:16-38 | Sources/CodexBarCore/Providers/Codex/CodexVisibleAccountProjection.swift:23-47 — 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) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthKeychainAccessGate.swift:27— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthKeychainAccessGate.swift:27-50 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthKeychainAccessGate.swift:85-107 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×8
Edited copies of one member (3 members, 7+ corresponding lines) Sources/CodexBarCore/BrowserDetection.swift:382— Sources/CodexBarCore/BrowserDetection.swift:382-395 | Sources/CodexBarCore/BrowserDetection.swift:397-411 | Sources/CodexBarCore/Plugins/ProviderBrowserProfile.swift:121-127 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:414— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:414-421 | Sources/CodexBarCore/Providers/Grok/GrokLocalSessionScanner.swift:243-249 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxBillingHistory.swift:352-359 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Sources/CodexBar/Providers/Codex/CodexAccountSwitcherView.swift:383— Sources/CodexBar/Providers/Codex/CodexAccountSwitcherView.swift:383-389 | Sources/CodexBar/Providers/Codex/CodexAccountSwitcherView.swift:391-398 | Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:941-947 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Sources/CodexBarCore/ProviderDetailSection.swift:63— Sources/CodexBarCore/ProviderDetailSection.swift:63-69 | Sources/CodexBarCore/ProviderDetailSection.swift:185-192 | Sources/CodexBarCore/ProviderDetailSection.swift:232-238 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Sources/CodexBar/Providers/Codex/CodexWorkspacesInspectorView.swift:215— Sources/CodexBar/Providers/Codex/CodexWorkspacesInspectorView.swift:215-224 | Sources/CodexBar/SessionUsageBrowser.swift:412-418 | Sources/CodexBar/SpendDashboard/SpendSessionToolActivityView.swift:196-203 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:314— Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:314-324 | Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:326-335 | Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:341-347 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Sources/CodexBarCLI/CLICardsBriefRenderer.swift:576— Sources/CodexBarCLI/CLICardsBriefRenderer.swift:576-582 | Sources/CodexBarCLI/CLICostCommand.swift:566-572 | Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageFetcher.swift:284-290 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Sources/CodexBar/Providers/DeepInfra/DeepInfraProviderImplementation.swift:12— Sources/CodexBar/Providers/DeepInfra/DeepInfraProviderImplementation.swift:12-18 | Sources/CodexBar/Providers/IBMBob/IBMBobProviderImplementation.swift:12-18 | Sources/CodexBar/Providers/Venice/VeniceProviderImplementation.swift:22-33 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×8
Edited copies of one member (3 members, 4+ corresponding lines) Sources/CodexBarCore/LocalAgentSessionScanner.swift:623— Sources/CodexBarCore/LocalAgentSessionScanner.swift:623-626 | Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:524-530 | Sources/CodexBarCore/RemoteSessionFetcher.swift:260-263 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Sources/CodexBar/Providers/Codex/CodexHistoryOwnership.swift:142— Sources/CodexBar/Providers/Codex/CodexHistoryOwnership.swift:142-145 | Sources/CodexBar/Providers/Codex/CodexOwnershipContext.swift:213-216 | Sources/CodexBarCLI/DashboardUsageAccount.swift:29-32 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Sources/CodexBarCore/Providers/Copilot/CopilotAccountIdentity.swift:57— Sources/CodexBarCore/Providers/Copilot/CopilotAccountIdentity.swift:57-60 | Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:608-611 | Sources/CodexBarCore/Providers/Copilot/CopilotProviderDescriptor.swift:229-232 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:326— Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:326-331 | Sources/CodexBarCore/PiSessionCostCache.swift:9-12 | Sources/CodexBarCore/Providers/Muse/MuseLocalUsageCache.swift:131-134 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:689— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:689-692 | Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:121-124 | Sources/CodexBarWidget/BurnDownWidgetViews.swift:599-602 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Sources/CodexBar/Providers/Codex/CodexConsumerProjection.swift:599— Sources/CodexBar/Providers/Codex/CodexConsumerProjection.swift:599-603 | Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift:251-254 | Sources/CodexBarCore/RateWindow+BindingCap.swift:44-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Sources/CodexBarCore/CodexLocalDataScope.swift:60— Sources/CodexBarCore/CodexLocalDataScope.swift:60-63 | Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthCredentials.swift:455-458 | Sources/CodexBarCore/Providers/Codex/CodexPAT/CodexPATUsageFetcher.swift:138-141 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalReader.swift:141— Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalReader.swift:141-144 | Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:654-658 | Sources/CodexBarCore/Providers/Muse/MuseLocalUsageReader.swift:586-589 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 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.
fetchUsage::parseQuota (cyclomatic 28) REDACTED:241— fetchUsage::parseQuota 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.
fetchUsage::summary (cyclomatic 25) REDACTED:82— fetchUsage::summary 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.
fetchUsage::parse (cyclomatic 22) Sources/CodexBarCore/Resources/Plugins/qoder.js:32— fetchUsage::parse 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.
fetchUsage::parseLimit (cyclomatic 22) Sources/CodexBarCore/Resources/Plugins/zai.js:72— fetchUsage::parseLimit 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.
fetchUsage::accounts (cyclomatic 21) REDACTED:38— fetchUsage::accounts 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.
fetchUsage::pages (cyclomatic 19) Sources/CodexBarCore/Resources/Plugins/openai.js:77— fetchUsage::pages 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.
fetchUsage::cookies (cyclomatic 16) Sources/CodexBarCore/Resources/Plugins/perplexity.js:18— fetchUsage::cookies 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.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×7
Edited copy of a member (29 corresponding lines) Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:274— Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:274-302 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:404-434 — 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) Sources/CodexBarCore/Providers/OpenCode/OpenCodeProviderDescriptor.swift:89— Sources/CodexBarCore/Providers/OpenCode/OpenCodeProviderDescriptor.swift:89-117 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift:450-481 — 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) Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:143— Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:143-178 | Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:182-210 — 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) Sources/CodexBarCore/Plugins/ScriptFetchStrategy.swift:49— Sources/CodexBarCore/Plugins/ScriptFetchStrategy.swift:49-78 | Sources/CodexBarCore/Plugins/ScriptFetchStrategy.swift:80-108 — 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) Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageSnapshot.swift:19— Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageSnapshot.swift:19-47 | Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:102-130 — 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) Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:1082— Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:1082-1110 | Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:644-673 — 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) Sources/CodexBarCore/AgentSession.swift:41— Sources/CodexBarCore/AgentSession.swift:41-69 | Sources/CodexBarCore/Providers/Grok/GrokAuth.swift:21-51 — 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 copies of one member (3 members, 8+ corresponding lines) · ×7
Edited copies of one member (3 members, 8+ corresponding lines) Sources/CodexBarCore/Providers/ClawRouter/ClawRouterSettingsReader.swift:36— Sources/CodexBarCore/Providers/ClawRouter/ClawRouterSettingsReader.swift:36-43 | Sources/CodexBarCore/Providers/Deepgram/DeepgramSettingsReader.swift:28-35 | Sources/CodexBarCore/Providers/Zai/ZaiSettingsReader.swift:134-141 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Sources/CodexBar/Settings/PreferencesDebugPane.swift:438— Sources/CodexBar/Settings/PreferencesDebugPane.swift:438-445 | Sources/CodexBar/Settings/PreferencesMenuPane.swift:244-251 | Sources/CodexBarCore/Config/CodexBarConfigValidation.swift:262-271 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:109— Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:109-116 | Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:83-93 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:188-195 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDirectKeychainReadConsent.swift:52— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDirectKeychainReadConsent.swift:52-60 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthKeychainPromptMode.swift:176-184 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthKeychainReadStrategy.swift:36-43 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials+TestingOverrides.swift:453— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials+TestingOverrides.swift:453-460 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:2532-2539 | Sources/CodexBarCore/Providers/Claude/ClaudeSourcePlanner.swift:127-134 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDirectKeychainReadConsent.swift:43— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDirectKeychainReadConsent.swift:43-50 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthKeychainPromptMode.swift:167-174 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthKeychainReadStrategy.swift:27-34 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Sources/CodexBarCore/KeychainCacheStore.swift:344— Sources/CodexBarCore/KeychainCacheStore.swift:344-351 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials+TestingOverrides.swift:444-451 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:2523-2530 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (6 lines × 4) Sources/CodexBarCore/CopilotUsageModels.swift:169— Sources/CodexBarCore/CopilotUsageModels.swift:169-174 | Sources/CodexBarCore/CopilotUsageModels.swift:206-211 | Sources/CodexBarCore/Providers/Codex/CodexSpendControlNumber.swift:9-14 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxDecoding.swift:22-27 — there are 4 copies across 3 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. 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 × 4) Sources/CodexBarCore/CopilotUsageModels.swift:169— Sources/CodexBarCore/CopilotUsageModels.swift:169-174 | Sources/CodexBarCore/CopilotUsageModels.swift:206-211 | Sources/CodexBarCore/Providers/Codex/CodexSpendControlNumber.swift:9-14 | Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:207-212 — there are 4 copies across 3 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. 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: the declarations holding them bind `container` to `KeyedDecodingContainer<CodingKeys>` in one and `KeyedDecodingContainer<DynamicCodingKey>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 4) Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:499— Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:499-504 | Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:540-546 | Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:582-588 | Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:627-632 — 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 `Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:499` 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, `Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:625` calls `setValue` and `Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:497` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 4) Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:219— Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:219-224 | Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:609-614 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:1317-1322 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:632-637 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (6 lines × 4) Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:332— Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:332-337 | Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:602-607 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:1310-1315 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:707-712 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:703` calls `String` and `Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:329` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 4) Sources/CodexBar/Providers/Amp/AmpSettingsStore.swift:7— Sources/CodexBar/Providers/Amp/AmpSettingsStore.swift:7-12 | Sources/CodexBar/Providers/CommandCode/CommandCodeSettingsStore.swift:7-12 | Sources/CodexBar/Providers/Grok/GrokSettingsStore.swift:7-12 | Sources/CodexBar/Providers/Ollama/OllamaSettingsStore.swift:10-15 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (6 lines × 4) Sources/CodexBar/Providers/Bedrock/BedrockSettingsStore.swift:7— Sources/CodexBar/Providers/Bedrock/BedrockSettingsStore.swift:7-12 | Sources/CodexBar/Providers/Bedrock/BedrockSettingsStore.swift:17-22 | Sources/CodexBar/Providers/Bedrock/BedrockSettingsStore.swift:27-32 | Sources/CodexBar/Providers/Doubao/DoubaoSettingsStore.swift:12-17 — 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.
Low cohesion: SettingsStore (LCOM4 16) Sources/CodexBar/Settings/SettingsStore.swift:244— SettingsStore's methods fall into 16 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 16 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: SidebarResizeHandleView (LCOM4 8) Sources/CodexBar/Settings/SidebarResizeHandle.swift:47— SidebarResizeHandleView's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: StatusItemController (LCOM4 7) Sources/CodexBar/StatusItem/StatusItemController.swift:41— StatusItemController's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: UsageStore (LCOM4 5) Sources/CodexBar/UsageStore/UsageStore.swift:121— UsageStore'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: PersistentRefreshMenuView (LCOM4 4) Sources/CodexBar/StatusItem/StatusItemController+MenuPresentation.swift:551— PersistentRefreshMenuView's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ProviderSwitcherView (LCOM4 4) Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:10— ProviderSwitcherView's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AntigravitySpawnedPTYProcessHandle (LCOM4 4) Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:971— AntigravitySpawnedPTYProcessHandle'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.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×6
Edited copies of one member (3 members, 12+ corresponding lines) Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:338— Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:338-351 | Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:482-494 | Sources/CodexBarCore/Providers/Codex/CodexRequestLedger.swift:44-55 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:230— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:230-246 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:248-264 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:1048-1059 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:367— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:367-386 | Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:427-441 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:654-665 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:1229— Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:1229-1240 | Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:1242-1253 | Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:555-566 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift:101— Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift:101-114 | Sources/CodexBarCore/Providers/Kilo/KiloProviderDescriptor.swift:100-111 | Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift:152-163 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) Sources/CodexBarCore/CostUsageFetcher.swift:101— Sources/CodexBarCore/CostUsageFetcher.swift:101-112 | Sources/CodexBarCore/CostUsageFetcher.swift:114-125 | Sources/CodexBarCore/CostUsageFetcher.swift:168-180 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (20 lines × 2) Sources/CodexBar/Providers/Codex/CodexLoginAlertPresentation.swift:9— Sources/CodexBar/Providers/Codex/CodexLoginAlertPresentation.swift:9-28 | Sources/CodexBar/Providers/Kiro/KiroLoginAlertPresentation.swift:4-23 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (20 lines × 2) Sources/CodexBar/QuotaWarningAlertOverlayController.swift:68— Sources/CodexBar/QuotaWarningAlertOverlayController.swift:68-87 | Sources/CodexBar/ScreenConfettiOverlayController.swift:39-58 — 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 `Sources/CodexBar/QuotaWarningAlertOverlayController.swift:68` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (20 lines × 2) Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:201— Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:201-220 | Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:225-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 `Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:201` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 2) Sources/CodexBarCore/CostUsageFetcher.swift:716— Sources/CodexBarCore/CostUsageFetcher.swift:716-735 | Sources/CodexBarCore/CostUsageFetcher.swift:824-843 — 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 `Sources/CodexBarCore/CostUsageFetcher.swift:716` 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 (20 lines × 2) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:593— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:593-612 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:726-745 — 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 `Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:593` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageSnapshot.swift:117— Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageSnapshot.swift:117-136 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageSnapshot.swift:96-115 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageSnapshot.swift:117` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:664— Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:664-679 | Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:688-703 — 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 `Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:664` 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) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:512— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:512-527 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:539-554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:54— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:54-69 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:65-80 — 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 `Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:54` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:306— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:306-321 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:229-244 — 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 `Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:306` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:172— Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:172-187 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift:249-264 — 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 `Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:172` 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 (16 lines × 2) Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:239— Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:239-254 | Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:261-276 — 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 (15 lines × 2) Sources/CodexBar/Menu/MenuCardView.swift:1137— Sources/CodexBar/Menu/MenuCardView.swift:1137-1151 | Sources/CodexBar/Menu/MenuDescriptor.swift:517-531 — 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 `Sources/CodexBar/Menu/MenuCardView.swift:1137` 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 (15 lines × 2) Sources/CodexBarCore/CopilotUsageModels.swift:165— Sources/CodexBarCore/CopilotUsageModels.swift:165-179 | Sources/CodexBarCore/CopilotUsageModels.swift:202-216 — 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 (15 lines × 2) Sources/CodexBarCore/CostUsageFetcher.swift:278— Sources/CodexBarCore/CostUsageFetcher.swift:278-292 | Sources/CodexBarCore/CostUsageFetcher.swift:472-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) Sources/CodexBarCore/Providers/Codex/CodexAccountReconciliation.swift:333— Sources/CodexBarCore/Providers/Codex/CodexAccountReconciliation.swift:333-347 | Sources/CodexBarCore/Providers/Codex/CodexSystemAccountObserver.swift:47-61 — 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 `Sources/CodexBarCore/Providers/Codex/CodexAccountReconciliation.swift:333` 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) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1109— Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1109-1123 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1174-1188 — 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 (15 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:74— Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:74-88 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift:74-88 — before extracting anything, compare `Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift` and `Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (26 corresponding lines) · ×5
Edited copy of a member (26 corresponding lines) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:694— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:694-724 | Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1400-1425 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:913— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:913-938 | Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:940-966 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:367— Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:367-393 | Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:395-420 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) Sources/CodexBarCLI/CLIUsageCommand.swift:335— Sources/CodexBarCLI/CLIUsageCommand.swift:335-360 | Sources/CodexBarCLI/CLIUsageCommand.swift:704-736 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) Sources/CodexBarCore/ProviderCostSnapshot.swift:27— Sources/CodexBarCore/ProviderCostSnapshot.swift:27-52 | Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:20-46 — 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 (27 corresponding lines) · ×5
Edited copy of a member (27 corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:594— Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:594-620 | Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:880-908 — 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) Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1649— Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1649-1679 | Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1681-1707 — 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) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter+Deadline.swift:96— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter+Deadline.swift:96-123 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter+Deadline.swift:125-151 — 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) Sources/CodexBar/Providers/Shared/ProviderSettingsDescriptors.swift:133— Sources/CodexBar/Providers/Shared/ProviderSettingsDescriptors.swift:133-159 | Sources/CodexBar/Providers/Shared/ProviderSettingsDescriptors.swift:317-343 — 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) Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:240— Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:240-269 | Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:271-297 — 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 copies of one member (3 members, 10+ corresponding lines) · ×5
Edited copies of one member (3 members, 10+ corresponding lines) Sources/CodexBarCore/CostUsageModels.swift:819— Sources/CodexBarCore/CostUsageModels.swift:819-828 | Sources/CodexBarCore/Providers/Antigravity/AntigravityOAuthCredentialsStore.swift:95-105 | Sources/CodexBarCore/UsageFetcher.swift:909-919 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:14— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:14-24 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:70-79 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:40-49 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1466— Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1466-1475 | Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1477-1486 | Sources/CodexBar/StatusItem/StatusItemController+UsageHistoryMenu.swift:12-21 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:265— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:265-277 | Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:577-586 | Sources/CodexBarCore/Providers/Codebuff/CodebuffProviderDescriptor.swift:81-92 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1289— Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1289-1298 | Sources/CodexBarCore/Providers/CodeRabbit/CodeRabbitUsageParser.swift:29-39 | Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:633-643 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×5
Edited copies of one member (4 members, 4+ corresponding lines) Sources/CodexBar/Providers/Codex/OpenAICreditsPurchaseWindowController.swift:482— Sources/CodexBar/Providers/Codex/OpenAICreditsPurchaseWindowController.swift:482-485 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardWebsiteDataStore.swift:162-165 | Sources/CodexBarCore/Providers/Codex/CodexIdentity.swift:22-27 | Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift:100-105 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 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.
Edited copies of one member (4 members, 4+ corresponding lines) Sources/CodexBarCore/KeychainStringStore.swift:156— Sources/CodexBarCore/KeychainStringStore.swift:156-159 | Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:94-101 | Sources/CodexBarCore/Providers/MiMo/MiMoUsageFetcher.swift:68-71 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxAuthMode.swift:40-47 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 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.
Edited copies of one member (4 members, 4+ corresponding lines) Sources/CodexBar/Providers/Antigravity/AntigravityProviderImplementation.swift:120— Sources/CodexBar/Providers/Antigravity/AntigravityProviderImplementation.swift:120-123 | Sources/CodexBar/Providers/Copilot/CopilotProviderImplementation.swift:28-33 | Sources/CodexBar/Providers/Devin/DevinProviderImplementation.swift:77-82 | Sources/CodexBar/Providers/Factory/FactoryProviderImplementation.swift:112-117 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 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.
Edited copies of one member (4 members, 4+ corresponding lines) Sources/CodexBarCLI/DashboardSnapshotBuilder.swift:326— Sources/CodexBarCLI/DashboardSnapshotBuilder.swift:326-329 | Sources/CodexBarCore/ProviderDetailSection.swift:314-317 | Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalReader.swift:89-92 | Sources/CodexBarCore/Providers/Muse/MuseLocalUsageReader.swift:581-584 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 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.
Edited copies of one member (4 members, 4+ corresponding lines) Sources/CodexBar/Menu/MenuCardView.swift:1215— Sources/CodexBar/Menu/MenuCardView.swift:1215-1218 | Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift:305-308 | Sources/CodexBarCore/Providers/Antigravity/AntigravityQuotaSummaryParser.swift:88-91 | Sources/CodexBarCore/Providers/Claude/ClaudeConfigPaths.swift:121-124 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 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, 3+ corresponding lines) · ×5
Edited copies of one member (3 members, 3+ corresponding lines) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:124— Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:124-126 | Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:275-281 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxCookieImporter.swift:107-110 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) Sources/CodexBarCore/Providers/IBMBob/IBMBobUsageFetcher.swift:97— Sources/CodexBarCore/Providers/IBMBob/IBMBobUsageFetcher.swift:97-99 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot.swift:217-219 | Sources/CodexBarCore/Providers/Wayfinder/WayfinderUsageFetcher.swift:165-169 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) Sources/CodexBarCore/Providers/Doubao/DoubaoSettingsReader.swift:30— Sources/CodexBarCore/Providers/Doubao/DoubaoSettingsReader.swift:30-34 | Sources/CodexBarCore/Providers/Fireworks/FireworksSettingsReader.swift:12-16 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPISettingsReader.swift:12-14 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) Sources/CodexBarCore/Providers/Amp/AmpSettingsReader.swift:6— Sources/CodexBarCore/Providers/Amp/AmpSettingsReader.swift:6-8 | Sources/CodexBarCore/Providers/Codebuff/CodebuffSettingsReader.swift:10-12 | Sources/CodexBarCore/Providers/Kilo/KiloSettingsReader.swift:6-8 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) Sources/CodexBarCore/CodexBarCoreResourceSmoke.swift:19— Sources/CodexBarCore/CodexBarCoreResourceSmoke.swift:19-21 | Sources/CodexBarCore/KeychainAccessGate.swift:92-96 | Sources/CodexBarCore/Plugins/ScriptFetchStrategy.swift:6-8 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (8 lines × 3) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:891— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:891-898 | Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:259-266 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:389-396 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:891` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:754— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:754-761 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:791-800 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:839-848 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:754` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:207— Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:207-214 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:498-505 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:818-825 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:207` 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, `Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:206` calls `String` and `Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:497` 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 × 3) Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift:331— Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift:331-338 | Sources/CodexBarCore/Providers/Devin/DevinAppSessionImporter.swift:255-262 | Sources/CodexBarCore/Providers/Windsurf/WindsurfStatusProbe.swift:119-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift:331` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) Sources/CodexBar/Providers/Antigravity/AntigravityProviderImplementation.swift:29— Sources/CodexBar/Providers/Antigravity/AntigravityProviderImplementation.swift:29-36 | Sources/CodexBar/Providers/Kilo/KiloProviderImplementation.swift:43-50 | Sources/CodexBar/Providers/Windsurf/WindsurfProviderImplementation.swift:19-26 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `ProviderSourceLabelContext` in one and `ProviderSettingsSnapshotContext` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 3) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:235— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:235-242 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:253-260 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:1052-1057 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 3) Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:31— Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:31-36 | Sources/CodexBarCore/Providers/Gemini/GeminiProviderDescriptor.swift:24-29 | Sources/CodexBarCore/Providers/Windsurf/WindsurfProviderDescriptor.swift:38-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:480— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:480-485 | Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:508-513 | Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:534-539 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:480` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 3) Sources/CodexBarCore/CostUsageModels.swift:849— Sources/CodexBarCore/CostUsageModels.swift:849-854 | Sources/CodexBarCore/CostUsageModels.swift:1348-1353 | Sources/CodexBarCore/CostUsageModels.swift:1418-1423 — 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. 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 × 3) Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:320— Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:320-325 | Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:472-477 | Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:616-621 — 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 before the matched lines, `Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:318` calls `decode`, `decodeIfPresent` and `Sources/CodexBarCore/CodexLocalProjectUsageModels.swift:615` 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.
Swallowed exception (empty catch) REDACTED:121— 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) Sources/CodexBarCore/Resources/Plugins/poe.js:106— 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) Sources/CodexBarCore/Resources/Plugins/t3chat.js:70— 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) Sources/CodexBarCore/Resources/Plugins/zai.js:266— 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) Sources/CodexBarCore/Resources/Plugins/zai.js:350— 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.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×4
Edited copy of a member (31 corresponding lines) Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:178— Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:178-213 | Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:215-245 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) Sources/CodexBar/StatusItem/StatusItemController+CompactAccountMenu.swift:31— Sources/CodexBar/StatusItem/StatusItemController+CompactAccountMenu.swift:31-61 | Sources/CodexBar/StatusItem/StatusItemController+CompactAccountMenu.swift:66-99 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) Sources/CodexBarCLI/CLIServeOperationCoordinator.swift:190— Sources/CodexBarCLI/CLIServeOperationCoordinator.swift:190-220 | Sources/CodexBarCLI/CLIServeOperationCoordinator.swift:222-257 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:743— Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:743-773 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:775-806 — 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 (24 corresponding lines) · ×4
Edited copy of a member (24 corresponding lines) Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:1127— Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:1127-1153 | Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:1155-1178 — 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) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter+Deadline.swift:45— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter+Deadline.swift:45-69 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter+Deadline.swift:71-94 — 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) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:52— Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:52-75 | Sources/CodexBarCore/Providers/Kimi/KimiCookieImporter.swift:46-69 — 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) Scripts/StoreStress/main.swift:323— Scripts/StoreStress/main.swift:323-357 | Scripts/StoreStress/main.swift:359-382 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×4
Edited copies of one member (3 members, 15+ corresponding lines) Sources/CodexBarCore/Providers/Codex/CodexSpendControlNumber.swift:21— Sources/CodexBarCore/Providers/Codex/CodexSpendControlNumber.swift:21-35 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxBillingHistory.swift:141-158 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxDecoding.swift:4-19 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:789— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:789-806 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1149-1165 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleSECTokenResolver.swift:137-151 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) Sources/CodexBarCore/AgentSession.swift:639— Sources/CodexBarCore/AgentSession.swift:639-653 | Sources/CodexBarCore/ProviderIdentitySnapshot.swift:16-30 | Sources/CodexBarCore/Providers/Codex/CodexDashboardAuthority.swift:72-88 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) Sources/CodexBarCore/ProviderThroughputSnapshot.swift:21— Sources/CodexBarCore/ProviderThroughputSnapshot.swift:21-35 | Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:21-37 | Sources/CodexBarCore/Providers/OpenAI/OpenAILiveUsage.swift:21-37 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×4
Edited copies of one member (3 members, 6+ corresponding lines) Sources/CodexBar/Providers/Codex/ManagedCodexAccountService.swift:72— Sources/CodexBar/Providers/Codex/ManagedCodexAccountService.swift:72-78 | Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift:776-783 | Sources/CodexBarCLI/CLICacheCommand.swift:128-133 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:244— Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:244-250 | Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:1038-1043 | Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:1055-1061 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:1150— Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:1150-1155 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:540-545 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:578-583 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) Sources/CodexBar/Providers/Cursor/CursorLoginRunner.swift:12— Sources/CodexBar/Providers/Cursor/CursorLoginRunner.swift:12-21 | Sources/CodexBarCore/CodexManagedAccounts.swift:113-120 | Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift:834-839 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (10–11 lines × 2) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:343— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:343-353 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:409-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:343` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–11 lines × 2) Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:319— Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:319-329 | Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:447-456 — 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 `Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:447` 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–11 lines × 2) Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:619— Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:619-629 | Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:666-675 — 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–11 lines × 2) Sources/CodexBarCore/UsagePace.swift:203— Sources/CodexBarCore/UsagePace.swift:203-213 | Sources/CodexBarCore/UsagePace.swift:243-252 — 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 `Sources/CodexBarCore/UsagePace.swift:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:701— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:701-710 | Sources/CodexBarCore/Providers/Mistral/MistralModels.swift:520-528 — 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 (9–10 lines × 2) Sources/CodexBar/Providers/Claude/ClaudeLoginRunner.swift:114— Sources/CodexBar/Providers/Claude/ClaudeLoginRunner.swift:114-122 | Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:697-706 — 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 `Sources/CodexBar/Providers/Claude/ClaudeLoginRunner.swift:114` 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 (9–10 lines × 2) Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:381— Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:381-389 | Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:429-438 — 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 `Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:381` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:368— Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:368-376 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:606-615 — 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 `Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:368` 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 (7 lines × 3) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:196— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:196-202 | Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:56-62 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:91-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:196` 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, `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:55` calls `chartYAxis` and `Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:195` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) Sources/CodexBar/ShareStatsPayload.swift:287— Sources/CodexBar/ShareStatsPayload.swift:287-293 | Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:135-141 | Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:930-936 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/ShareStatsPayload.swift:287` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) Sources/CodexBarCore/CopilotUsageModels.swift:169— Sources/CodexBarCore/CopilotUsageModels.swift:169-175 | Sources/CodexBarCore/CopilotUsageModels.swift:206-212 | Sources/CodexBarCore/Providers/Codex/CodexSpendControlNumber.swift:9-15 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/CopilotUsageModels.swift:169` 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 × 3) Sources/CodexBarCore/Providers/ElevenLabs/ElevenLabsSettingsReader.swift:11— Sources/CodexBarCore/Providers/ElevenLabs/ElevenLabsSettingsReader.swift:11-17 | Sources/CodexBarCore/Providers/NeuralWatt/NeuralWattSettingsReader.swift:10-16 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:816-824 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 4) Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:204— Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:204-211 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:336-343 | Sources/CodexBarCore/CostUsageModels.swift:1601-1606 | Sources/CodexBarCore/PiSessionCostScanner.swift:1354-1358 — before extracting anything, compare `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift` and `Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 172 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 4) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:776— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:776-780 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1169-1173 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageParser.swift:181-185 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleSECTokenResolver.swift:155-159 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:776` 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 (5 lines × 4) Sources/CodexBarCore/Providers/AiAnd/AiAndSettingsReader.swift:6— Sources/CodexBarCore/Providers/AiAnd/AiAndSettingsReader.swift:6-10 | Sources/CodexBarCore/Providers/ClinePass/ClinePassSettingsReader.swift:6-10 | Sources/CodexBarCore/Providers/DeepInfra/DeepInfraSettingsReader.swift:6-10 | Sources/CodexBarCore/Providers/Poe/PoeSettingsReader.swift:6-10 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (5 lines × 4) Sources/CodexBarCLI/CLIRenderer.swift:169— Sources/CodexBarCLI/CLIRenderer.swift:169-173 | Sources/CodexBarCLI/CLIRenderer.swift:209-213 | Sources/CodexBarCLI/CLIRenderer.swift:233-237 | Sources/CodexBarCLI/CLIRenderer.swift:310-314 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:556— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:556-560 | Sources/CodexBarCore/Providers/Grok/GrokRemainingResetsFetcher.swift:333-337 | Sources/CodexBarCore/Providers/Grok/GrokWebBillingFetcher.swift:262-266 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:556` 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 (5 lines × 3) Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:74— Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:74-78 | Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:89-93 | Sources/CodexBarCore/Providers/Perplexity/PerplexityCookieImporter.swift:113-117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) Sources/CodexBarCore/Providers/Groq/GroqConsoleFetcher.swift:175— Sources/CodexBarCore/Providers/Groq/GroqConsoleFetcher.swift:175-179 | Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:330-334 | Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:342-346 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:348` calls `response`, `statusError` and `Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:335` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift:54— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift:54-58 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanSettingsReader.swift:14-18 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudSettingsReader.swift:8-12 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
fetchUsage (cyclomatic 35) Sources/CodexBarCore/Resources/Plugins/flora.js:11— fetchUsage has cyclomatic complexity 35 (threshold 15). Of this number, 31 points are the body's own statements and 4 belong to 5 function items inside it that branch. 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.
fetchUsage (cyclomatic 35) Sources/CodexBarCore/Resources/Plugins/sakana.js:12— fetchUsage has cyclomatic complexity 35 (threshold 15). Of this number, 17 points are the body's own statements and 18 belong to 7 function items inside it that branch. 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.
fetchUsage (cyclomatic 35) Sources/CodexBarCore/Resources/Plugins/venice.js:15— fetchUsage has cyclomatic complexity 35 (threshold 15). Of this number, 29 points are the body's own statements and 6 belong to one function item inside it that branches. 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.
fetchUsage (cyclomatic 16) REDACTED:8— fetchUsage 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.
fetchUsage (cyclomatic 16) Sources/CodexBarCore/Resources/Plugins/qoder.js:8— fetchUsage 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.
fetchUsage (cyclomatic 16) Sources/CodexBarCore/Resources/Plugins/tinyapi.js:8— fetchUsage 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.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×3
Edited copy of a member (35 corresponding lines) Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:64— Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:64-98 | Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:66-106 — 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.
Edited copy of a member (35 corresponding lines) Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:454— Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:454-490 | Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:492-526 — 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.
Edited copy of a member (35 corresponding lines) Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:1218— Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:1218-1256 | Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:1258-1292 — 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 (38 corresponding lines) · ×3
Edited copy of a member (38 corresponding lines) Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:551— Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:551-588 | Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:590-634 — 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) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:144— Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:144-185 | Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:187-224 — 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) Sources/CodexBarCLI/CLIHelp.swift:37— Sources/CodexBarCLI/CLIHelp.swift:37-74 | Sources/CodexBarCLI/CLIHelp.swift:76-124 — 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 copies of one member (3 members, 18+ corresponding lines) · ×3
Edited copies of one member (3 members, 18+ corresponding lines) Sources/CodexBarCore/Providers/Antigravity/AntigravityOAuthCredentialsStore.swift:50— Sources/CodexBarCore/Providers/Antigravity/AntigravityOAuthCredentialsStore.swift:50-67 | Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:922-946 | Sources/CodexBarCore/Providers/VertexAI/VertexAIOAuth/VertexAIIDToken.swift:5-27 — 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.
Edited copies of one member (3 members, 18+ corresponding lines) Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:257— Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:257-275 | Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:637-654 | Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:713-731 — 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.
Edited copies of one member (3 members, 18+ corresponding lines) Sources/CodexBarCore/Providers/Mistral/MistralProviderDescriptor.swift:245— Sources/CodexBarCore/Providers/Mistral/MistralProviderDescriptor.swift:245-262 | Sources/CodexBarCore/Providers/Mistral/MistralProviderDescriptor.swift:264-283 | Sources/CodexBarCore/Providers/Mistral/MistralProviderDescriptor.swift:285-304 — 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, 11+ corresponding lines) · ×3
Edited copies of one member (3 members, 11+ corresponding lines) Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:166— Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:166-176 | Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:109-119 | Sources/CodexBarCore/Providers/Cursor/CursorProviderDescriptor.swift:199-213 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) Sources/CodexBarCLI/DashboardPayloads.swift:167— Sources/CodexBarCLI/DashboardPayloads.swift:167-177 | Sources/CodexBarCLI/DashboardPayloads.swift:253-263 | Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift:250-261 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) Sources/CodexBarCLI/CLIConfigCommand.swift:327— Sources/CodexBarCLI/CLIConfigCommand.swift:327-337 | Sources/CodexBarCLI/CLIConfigCookieCommand.swift:89-104 | Sources/CodexBarCLI/CLIConfigSourceCommand.swift:59-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×3
Edited copies of one member (3 members, 5+ corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:139— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:139-143 | Sources/CodexBarCore/Providers/Kilo/KiloProviderDescriptor.swift:124-132 | Sources/CodexBarCore/Providers/Kilo/KiloProviderDescriptor.swift:150-156 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:559— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:559-563 | Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:656-660 | Sources/CodexBarCLI/CLICostCommand.swift:549-553 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) Sources/CodexBarCore/Providers/Helmcode/HelmcodeProviderSettings.swift:12— Sources/CodexBarCore/Providers/Helmcode/HelmcodeProviderSettings.swift:12-16 | Sources/CodexBarCore/Providers/Muse/MuseProviderSettings.swift:13-17 | Sources/CodexBarCore/Providers/Shared/ProviderCookieSettings.swift:32-36 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 3+ corresponding lines) · ×3
Edited copies of one member (4 members, 3+ corresponding lines) Sources/CodexBarCore/CodexManagedAccounts.swift:109— Sources/CodexBarCore/CodexManagedAccounts.swift:109-111 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials+Hashing.swift:10-14 | Sources/CodexBarCore/Providers/Doubao/DoubaoVolcengineSigner.swift:100-102 | Sources/CodexBarCore/Sync/CanonicalSyncJSON.swift:33-35 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 3+ corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:283— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:283-285 | Sources/CodexBarCore/Providers/AzureOpenAI/AzureOpenAIProviderDescriptor.swift:124-126 | Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:594-596 | Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift:433-435 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 3+ corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaProviderSettings.swift:34— Sources/CodexBarCore/Providers/Alibaba/AlibabaProviderSettings.swift:34-36 | Sources/CodexBarCore/Providers/Helmcode/HelmcodeProviderSettings.swift:8-10 | Sources/CodexBarCore/Providers/Muse/MuseProviderSettings.swift:9-11 | Sources/CodexBarCore/Providers/Qoder/QoderProviderSettings.swift:8-10 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (27 lines × 2) Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:84— Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:84-110 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:121-147 — before extracting anything, compare `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift` and `Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 172 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 `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27 lines × 2) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:146— Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:146-172 | Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:188-214 — 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 `Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:146` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (27 lines × 2) Sources/CodexBarCore/Providers/LLMProxy/LLMProxySettingsReader.swift:7— Sources/CodexBarCore/Providers/LLMProxy/LLMProxySettingsReader.swift:7-33 | Sources/CodexBarCore/Providers/LiteLLM/LiteLLMSettingsReader.swift:8-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/LLMProxy/LLMProxySettingsReader.swift:7` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodexBarCore/Providers/LiteLLM/LiteLLMSettingsReader.swift:40` calls `setExtensionValue` and `Sources/CodexBarCore/Providers/LLMProxy/LLMProxySettingsReader.swift:33` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1130— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1130-1146 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1203-1219 — 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 `Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `now` to `Date = Date()` in one and `Date` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (17 lines × 2) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe+SessionResolution.swift:132— Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe+SessionResolution.swift:132-148 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe+SessionResolution.swift:154-170 — 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 `Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe+SessionResolution.swift:132` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:311— Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:311-327 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:758-774 — 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 `Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:311` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) Sources/CodexBarCore/Providers/Codex/CodexVisibleAccountProjection.swift:238— Sources/CodexBarCore/Providers/Codex/CodexVisibleAccountProjection.swift:238-250 | Sources/CodexBarCore/Providers/Codex/CodexVisibleAccountProjection.swift:257-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Codex/CodexVisibleAccountProjection.swift:257` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:548— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:548-561 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:869-881 — 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–14 lines × 2) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:430— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:430-443 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:670-682 — 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 `Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:430` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–12 lines × 2) Sources/CodexBar/Providers/Codex/CodexAccountUsageSnapshotStore.swift:221— Sources/CodexBar/Providers/Codex/CodexAccountUsageSnapshotStore.swift:221-230 | Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:440-451 — 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 `Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:440` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–12 lines × 2) Sources/CodexBarCore/Providers/Devin/DevinSessionImporter.swift:188— Sources/CodexBarCore/Providers/Devin/DevinSessionImporter.swift:188-197 | Sources/CodexBarCore/Providers/Windsurf/WindsurfDevinSessionImporter.swift:160-171 — 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–12 lines × 2) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:478— Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:478-487 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:792-803 — 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 `Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:478` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 4) Sources/CodexBarCore/Providers/Grok/GrokCLISettingsFetcher.swift:30— Sources/CodexBarCore/Providers/Grok/GrokCLISettingsFetcher.swift:30-36 | Sources/CodexBarCore/Providers/Grok/GrokCreditsProxyFetcher.swift:27-33 | Sources/CodexBarCore/Providers/Grok/GrokRemainingResetsFetcher.swift:339-345 | Sources/CodexBarCore/Providers/Grok/GrokWebBillingFetcher.swift:268-274 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Grok/GrokCLISettingsFetcher.swift:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) Sources/CodexBar/Providers/Copilot/CopilotTokenStore.swift:14— Sources/CodexBar/Providers/Copilot/CopilotTokenStore.swift:14-20 | Sources/CodexBar/Providers/Kimi/KimiTokenStore.swift:14-20 | Sources/CodexBar/Providers/MiniMax/MiniMaxAPITokenStore.swift:14-20 | Sources/CodexBar/Providers/Synthetic/SyntheticTokenStore.swift:14-20 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (7 lines × 4) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift:60— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift:60-66 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxSettingsReader.swift:55-61 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxSettingsReader.swift:63-69 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxSettingsReader.swift:71-77 — 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.
Dead file (~174 LoC) Sources/CodexBarCore/Resources/Plugins/longcat.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~174 LoC) REDACTED— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~174 LoC) Sources/CodexBarCore/Resources/Plugins/typesafe.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~172 LoC) Sources/CodexBarCore/Resources/Plugins/clawrouter.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~172 LoC) Sources/CodexBarCore/Resources/Plugins/raycast.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~172 LoC) Sources/CodexBarCore/Resources/Plugins/v0.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
fetchUsage (cyclomatic 26) Sources/CodexBarCore/Resources/Plugins/fal.js:8— fetchUsage has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
fetchUsage (cyclomatic 26) Sources/CodexBarCore/Resources/Plugins/tavily.js:8— fetchUsage has cyclomatic complexity 26 (threshold 15). Of this number, 19 points are the body's own statements and 7 belong to 6 function items inside it that branch. 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.
fetchUsage (cognitive 62) Sources/CodexBarCore/Resources/Plugins/t3chat.js:12— fetchUsage has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 22, loops 6 (8 pts), ternaries 4, error handling 1 (2 pts), other 2 (nesting depth added 12). Of this number, 50 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage (cognitive 62) Sources/CodexBarCore/Resources/Plugins/zed.js:12— fetchUsage has cognitive complexity 62 (threshold 15). Drivers by points: if/else 24 (31 pts), ternaries 14 (21 pts), boolean chains 9, error handling 1 (nesting depth added 14). Of this number, 53 points are the body's own statements and 9 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage (cognitive 38) REDACTED:11— fetchUsage has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 20 (24 pts), boolean chains 16, if/else 11 (16 pts), other 6, loops 3 (4 pts), error handling 2 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
fetchUsage (cognitive 38) Sources/CodexBarCore/Resources/Plugins/traecn.js:9— fetchUsage has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 7 (12 pts), boolean chains 8, other 2, error handling 1, loops 1 (nesting depth added 10). Of this number, 26 points are the body's own statements and 12 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage (cognitive 37) Sources/CodexBarCore/Resources/Plugins/sakana.js:12— fetchUsage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 12, ternaries 6 (10 pts) (nesting depth added 7). Of this number, 22 points are the body's own statements and 15 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage (cognitive 37) REDACTED:11— fetchUsage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 11, ternaries 4, error handling 2 (3 pts), loops 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 21 belong to 7 function items inside it that branch. 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.
fetchUsage (cognitive 36) Sources/CodexBarCore/Resources/Plugins/flora.js:11— fetchUsage has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 11, other 4, ternaries 3 (4 pts), error handling 1 (nesting depth added 3). Of this number, 32 points are the body's own statements and 4 belong to 5 function items inside it that branch. 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.
fetchUsage (cognitive 36) Sources/CodexBarCore/Resources/Plugins/xapi.js:15— fetchUsage has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 3 (5 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (nesting depth added 15). Of this number, 16 points are the body's own statements and 20 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chutes.chutesMinutes (cognitive 28) Sources/CodexBarCore/Resources/Plugins/chutes.js:121— chutes.chutesMinutes has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (19 pts), if/else 4 (6 pts), boolean chains 2, loops 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.
chutes.chutesMinutes (cognitive 28) Sources/CodexBarCore/Resources/Plugins/chutes.ts:94— chutes.chutesMinutes has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (19 pts), if/else 4 (6 pts), boolean chains 2, loops 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.
fetchUsage (cognitive 24) REDACTED:8— fetchUsage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 8 (10 pts), loops 5 (8 pts), other 7, boolean chains 6, error handling 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage (cognitive 24) Sources/CodexBarCore/Resources/Plugins/qoder.js:8— fetchUsage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 15, ternaries 8 (10 pts), loops 5 (7 pts), other 6, error handling 3 (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.
D4 · Code Duplication· Members sharing a duplicated core (11 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (11 members, 50+ identical tokens) Sources/CodexBarCore/CookieHeaderNormalizer.swift:64— Sources/CodexBarCore/CookieHeaderNormalizer.swift:64-78 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:63-74 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:184-199 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:555-580 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:589-596 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:1332-1382 | Sources/CodexBarCore/Providers/Factory/FactoryManualCredentials.swift:32-44 | Sources/CodexBarCore/Providers/Kimi/KimiCookieHeader.swift:45-65 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:1199-1207 | Sources/CodexBarCore/TextParsing.swift:13-21 | Sources/CodexBarCore/TextParsing.swift:74-87 — These 11 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 11 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 11 times.
Members sharing a duplicated core (11 members, 50+ identical tokens) Sources/CodexBarCore/PathEnvironment.swift:59— Sources/CodexBarCore/PathEnvironment.swift:59-79 | Sources/CodexBarCore/PathEnvironment.swift:81-104 | Sources/CodexBarCore/PathEnvironment.swift:121-149 | Sources/CodexBarCore/PathEnvironment.swift:151-179 | Sources/CodexBarCore/PathEnvironment.swift:198-222 | Sources/CodexBarCore/PathEnvironment.swift:224-244 | Sources/CodexBarCore/PathEnvironment.swift:246-266 | Sources/CodexBarCore/PathEnvironment.swift:289-308 | Sources/CodexBarCore/PathEnvironment.swift:320-338 | Sources/CodexBarCore/PathEnvironment.swift:340-363 | Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift:323-339 — These 11 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 11 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 11 times.
D4 · Code Duplication· Edited copy of a member (53 corresponding lines) · ×2
Edited copy of a member (53 corresponding lines) Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:165— Sources/CodexBarCore/Providers/Amp/AmpUsageFetcher.swift:165-217 | Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:570-630 — 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) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:931— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:931-983 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:985-1040 — 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 (43 corresponding lines) · ×2
Edited copy of a member (43 corresponding lines) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1271— Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1271-1313 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1340-1383 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) Sources/AdaptiveReplayKit/AdaptiveRefreshTrace.swift:71— Sources/AdaptiveReplayKit/AdaptiveRefreshTrace.swift:71-113 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:403-445 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (42 corresponding lines) · ×2
Edited copy of a member (42 corresponding lines) Sources/CodexBarCore/Providers/Replicate/ReplicateWebFetchStrategy.swift:51— Sources/CodexBarCore/Providers/Replicate/ReplicateWebFetchStrategy.swift:51-92 | Sources/CodexBarCore/Providers/TypeSafe/TypeSafeWebFetchStrategy.swift:82-125 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (42 corresponding lines) Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageFetcher.swift:83— Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageFetcher.swift:83-136 | Sources/CodexBarCore/Providers/CommandCode/CommandCodeUsageFetcher.swift:170-211 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×2
Edited copy of a member (34 corresponding lines) Sources/CodexBarCore/Providers/Grok/GrokRPCClient.swift:111— Sources/CodexBarCore/Providers/Grok/GrokRPCClient.swift:111-144 | Sources/CodexBarCore/UsageFetcher.swift:1095-1128 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:402— Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:402-437 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:816-849 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×2
Edited copy of a member (36 corresponding lines) Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:166— Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:166-201 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift:243-278 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift:227— Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift:227-262 | Sources/CodexBarCore/UsageFetcher.swift:1522-1561 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×2
Edited copies of one member (3 members, 21+ corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:133— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:133-159 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:199-219 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:119-143 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 21+ corresponding lines) Sources/CodexBarCore/CookieHeaderCache.swift:536— Sources/CodexBarCore/CookieHeaderCache.swift:536-556 | Sources/CodexBarCore/CookieHeaderCache.swift:560-583 | Sources/CodexBarCore/CookieHeaderCache.swift:1189-1213 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×2
Edited copy of a member (25 corresponding lines) Sources/CodexBarCore/Providers/Codex/CodexAccountReconciliation.swift:329— Sources/CodexBarCore/Providers/Codex/CodexAccountReconciliation.swift:329-353 | Sources/CodexBarCore/Providers/Codex/CodexSystemAccountObserver.swift:42-68 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift:394— Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift:394-425 | Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift:462-486 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×2
Edited copies of one member (3 members, 13+ corresponding lines) Sources/CodexBarCore/CostUsageModels.swift:802— Sources/CodexBarCore/CostUsageModels.swift:802-817 | Sources/CodexBarCore/CostUsageModels.swift:1304-1316 | Sources/CodexBarCore/CostUsageModels.swift:1449-1461 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:426— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:426-438 | Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:440-452 | Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:454-466 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×2
Edited copies of one member (3 members, 19+ corresponding lines) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1051— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1051-1069 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1090-1113 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1115-1137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) Sources/CodexBarCore/CookieHeaderCache.swift:869— Sources/CodexBarCore/CookieHeaderCache.swift:869-890 | Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:1263-1281 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthPendingCacheClearStore.swift:388-410 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×2
Edited copies of one member (4 members, 10+ corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:142— Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:142-156 | Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:158-167 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift:152-166 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift:168-177 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 10+ corresponding lines) Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:977— Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:977-986 | Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:988-997 | Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:1010-1019 | Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:1021-1030 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 23+ corresponding lines) · ×2
Edited copies of one member (3 members, 23+ corresponding lines) Sources/CodexBarCore/Providers/Devin/DevinSessionImporter.swift:243— Sources/CodexBarCore/Providers/Devin/DevinSessionImporter.swift:243-268 | Sources/CodexBarCore/Providers/Devin/DevinUsageSnapshot.swift:160-183 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoZenBalanceParser.swift:70-92 — 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.
Edited copies of one member (3 members, 23+ corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:21— Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:21-45 | Sources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swift:56-78 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift:21-45 — 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 (5 members, 11+ corresponding lines) · ×2
Edited copies of one member (5 members, 11+ corresponding lines) Sources/CodexBar/Menu/MenuBarLayoutConditionalEditor.swift:197— Sources/CodexBar/Menu/MenuBarLayoutConditionalEditor.swift:197-207 | Sources/CodexBar/Menu/MenuBarLayoutConditionalEditor.swift:209-223 | Sources/CodexBar/Menu/MenuBarLayoutConditionalEditor.swift:225-235 | Sources/CodexBar/Menu/MenuBarLayoutConditionalEditor.swift:237-247 | Sources/CodexBar/Menu/MenuBarLayoutConditionalEditor.swift:249-260 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 11+ corresponding lines) Sources/CodexBar/Providers/Claude/ClaudeSettingsStore.swift:10— Sources/CodexBar/Providers/Claude/ClaudeSettingsStore.swift:10-25 | Sources/CodexBar/Providers/Factory/FactorySettingsStore.swift:13-24 | Sources/CodexBar/Providers/Kilo/KiloSettingsStore.swift:10-20 | Sources/CodexBar/Providers/Kimi/KimiSettingsStore.swift:12-23 | Sources/CodexBar/Providers/Venice/VeniceSettingsStore.swift:10-20 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×2
Edited copies of one member (3 members, 16+ corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:270— Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:270-286 | Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:309-324 | Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:839-856 — 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.
Edited copies of one member (3 members, 16+ corresponding lines) Sources/CodexBar/MouseLocationReader.swift:35— Sources/CodexBar/MouseLocationReader.swift:35-52 | Sources/CodexBar/Settings/SidebarResizeHandle.swift:84-99 | Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:229-248 — 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 (6 members, 8+ corresponding lines) · ×2
Edited copies of one member (6 members, 8+ corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanCookieImporter.swift:40— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanCookieImporter.swift:40-47 | Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanCookieImporter.swift:49-56 | Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:134-141 | Sources/CodexBarCore/Providers/Windsurf/WindsurfDevinSessionImporter.swift:21-28 | Sources/CodexBarCore/Providers/Windsurf/WindsurfDevinSessionImporter.swift:30-39 | Sources/CodexBarCore/Providers/Windsurf/WindsurfDevinSessionImporter.swift:41-50 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 8+ corresponding lines) Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:74— Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:74-81 | Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:89-96 | Sources/CodexBarCore/Providers/Kimi/KimiCookieImporter.swift:116-126 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxCookieImporter.swift:96-105 | Sources/CodexBarCore/Providers/Mistral/MistralCookieImporter.swift:37-46 | Sources/CodexBarCore/Providers/Perplexity/PerplexityCookieImporter.swift:113-122 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×2
Edited copies of one member (4 members, 7+ corresponding lines) Sources/CodexBarCore/Providers/MiMo/MiMoUsageSnapshot.swift:99— Sources/CodexBarCore/Providers/MiMo/MiMoUsageSnapshot.swift:99-105 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleTokenPlanSnapshot.swift:112-119 | Sources/CodexBarCore/UsageFormatter.swift:236-243 | TestsPlugin/ManusReference.swift:126-133 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 7+ corresponding lines) Sources/CodexBar/HistoricalUsagePace.swift:704— Sources/CodexBar/HistoricalUsagePace.swift:704-710 | Sources/CodexBar/Providers/Codex/CodexAccountUsageSnapshotStore.swift:248-254 | Sources/CodexBar/Sync/CloudSyncPersistence.swift:153-160 | Sources/CodexBarCore/TokenAccounts.swift:223-229 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 4+ corresponding lines) · ×2
Edited copies of one member (5 members, 4+ corresponding lines) Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:647— Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:647-654 | Sources/CodexBarCLI/DashboardSnapshotBuilder.swift:619-622 | Sources/CodexBarCore/CostUsageModels.swift:1583-1586 | Sources/CodexBarCore/OpenAIDashboardModels.swift:339-345 | docs/images/token-activity-readability/runtime/ActivityDashboardRuntimeProof.swift:184-187 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 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.
Edited copies of one member (5 members, 4+ corresponding lines) Sources/CodexBarCore/Providers/Chutes/ChutesSettingsReader.swift:30— Sources/CodexBarCore/Providers/Chutes/ChutesSettingsReader.swift:30-33 | Sources/CodexBarCore/Providers/Codebuff/CodebuffSettingsReader.swift:55-58 | Sources/CodexBarCore/Providers/ElevenLabs/ElevenLabsSettingsReader.swift:34-37 | Sources/CodexBarCore/Providers/Groq/GroqSettingsReader.swift:30-33 | Sources/CodexBarCore/Providers/NeuralWatt/NeuralWattSettingsReader.swift:33-36 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 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.
Duplicated block (25 lines × 2) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:786— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:786-810 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:834-858 — 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 `Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:786` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (25 lines × 2) Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:64— Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:64-88 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieHeaders.swift:116-140 — before extracting anything, compare `Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift` and `Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieHeaders.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:64` 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 (23–24 lines × 2) Sources/CodexBar/IconRenderer.swift:805— Sources/CodexBar/IconRenderer.swift:805-828 | Sources/CodexBar/IconRenderer.swift:837-859 — 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 `Sources/CodexBar/IconRenderer.swift:805` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–24 lines × 2) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:316— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:316-339 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:939-961 — 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 `Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:939` 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, `Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:939` calls `isAuthenticationError` and `Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:316` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (23 lines × 2) Sources/CodexBar/ScreenConfettiOverlayController.swift:143— Sources/CodexBar/ScreenConfettiOverlayController.swift:143-165 | Sources/CodexBar/ScreenConfettiOverlayController.swift:174-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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/ScreenConfettiOverlayController.swift:143` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) Sources/CodexBar/SpendDashboard/SpendDashboardSource+OpenCodex.swift:13— Sources/CodexBar/SpendDashboard/SpendDashboardSource+OpenCodex.swift:13-35 | Sources/CodexBar/SpendDashboard/SpendDashboardSource+OpenCodex.swift:50-72 — 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 `Sources/CodexBar/SpendDashboard/SpendDashboardSource+OpenCodex.swift:13` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:309— Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:309-326 | Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:342-359 — 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 `Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (18 lines × 2) Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:455— Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:455-472 | Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:493-510 — 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 `Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:455` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `cookieHeader` to `String) async throws -> (AugmentCreditsResponse` in one and `String) async throws -> (AugmentSubscriptionResponse` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14–15 lines × 2) Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:1243— Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:1243-1256 | Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:1278-1292 — 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 `Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:1243` 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 (14–15 lines × 2) Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:117— Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:117-130 | Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:241-255 — 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 `Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:705— Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:705-717 | Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:769-781 | Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:825-837 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:705` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:775— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:775-787 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:1168-1180 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleSECTokenResolver.swift:154-166 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. 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–12 lines × 3) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:567— Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:567-578 | Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:729-738 | Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:792-801 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:567` 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 (10–12 lines × 3) Sources/CodexBarCore/Providers/Antigravity/AntigravityOAuthCredentialsStore.swift:54— Sources/CodexBarCore/Providers/Antigravity/AntigravityOAuthCredentialsStore.swift:54-63 | Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:928-939 | Sources/CodexBarCore/Providers/VertexAI/VertexAIOAuth/VertexAIIDToken.swift:11-22 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Antigravity/AntigravityOAuthCredentialsStore.swift:54` 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–11 lines × 3) Sources/CodexBarCLI/CLIConfigClearCredentialCommand.swift:12— Sources/CodexBarCLI/CLIConfigClearCredentialCommand.swift:12-21 | Sources/CodexBarCLI/CLIConfigCommand.swift:101-110 | Sources/CodexBarCLI/CLIConfigCommand.swift:150-160 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10–11 lines × 3) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1064— Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1064-1074 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1104-1113 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1169-1178 — 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, `Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1114` calls `setValue` and `Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1075` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) Sources/CodexBarCore/CookieHeaderCache+Fingerprint.swift:11— Sources/CodexBarCore/CookieHeaderCache+Fingerprint.swift:11-21 | Sources/CodexBarCore/CookieHeaderCache.swift:88-98 | Sources/CodexBarCore/CookieHeaderCache.swift:101-111 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/CookieHeaderCache+Fingerprint.swift:11` 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 (11 lines × 3) Sources/CodexBar/Providers/Antigravity/AntigravitySettingsStore.swift:76— Sources/CodexBar/Providers/Antigravity/AntigravitySettingsStore.swift:76-86 | Sources/CodexBar/Providers/Kilo/KiloSettingsStore.swift:59-69 | Sources/CodexBar/Providers/Windsurf/WindsurfSettingsStore.swift:49-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (8–9 lines × 3) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:699— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:699-707 | Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1405-1412 | Sources/CodexBarCore/Providers/Mistral/MistralModels.swift:518-525 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1413` calls `bucketCalendar` and `Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:708` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 3) Sources/CodexBarCore/Providers/Grok/GrokCreditsProxyFetcher.swift:28— Sources/CodexBarCore/Providers/Grok/GrokCreditsProxyFetcher.swift:28-35 | Sources/CodexBarCore/Providers/Grok/GrokRemainingResetsFetcher.swift:340-348 | Sources/CodexBarCore/Providers/Grok/GrokWebBillingFetcher.swift:269-276 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Grok/GrokCreditsProxyFetcher.swift:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 3) Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:542— Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:542-550 | Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:566-574 | Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:344-352 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:542` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 3) Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:162— Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:162-170 | Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift:67-75 | Sources/CodexBarCore/Providers/Gemini/GeminiProviderDescriptor.swift:40-48 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:162` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6–9 lines × 2) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:1281— Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:1281-1289 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:41-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:41` 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–9 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:1140— Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:1140-1148 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:1162-1167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 2) Sources/CodexBar/ShareStatsPayload.swift:446— Sources/CodexBar/ShareStatsPayload.swift:446-451 | Sources/CodexBar/ShareStatsPayload.swift:464-470 — 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 `Sources/CodexBar/ShareStatsPayload.swift:446` 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 (6–7 lines × 2) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:927— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:927-933 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardWebsiteDataStore.swift:135-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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:927` 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 (3–6 lines × 11) Sources/CodexBarCore/PathEnvironment.swift:62— Sources/CodexBarCore/PathEnvironment.swift:62-67 | Sources/CodexBarCore/PathEnvironment.swift:84-89 | Sources/CodexBarCore/PathEnvironment.swift:124-129 | Sources/CodexBarCore/PathEnvironment.swift:152-154 | Sources/CodexBarCore/PathEnvironment.swift:201-206 | Sources/CodexBarCore/PathEnvironment.swift:227-232 | Sources/CodexBarCore/PathEnvironment.swift:249-254 | Sources/CodexBarCore/PathEnvironment.swift:292-297 | Sources/CodexBarCore/PathEnvironment.swift:323-328 | Sources/CodexBarCore/PathEnvironment.swift:343-348 | Sources/CodexBarCore/Providers/Codex/CodexProviderDescriptor.swift:326-331 — there are 11 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 11 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/PathEnvironment.swift:62` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (3–6 lines × 11) Sources/CodexBarCore/CookieHeaderNormalizer.swift:68— Sources/CodexBarCore/CookieHeaderNormalizer.swift:68-73 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:66-68 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:191-193 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:563-565 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:591-593 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:1337-1339 | Sources/CodexBarCore/Providers/Factory/FactoryManualCredentials.swift:35-37 | Sources/CodexBarCore/Providers/Kimi/KimiCookieHeader.swift:54-59 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:1201-1203 | Sources/CodexBarCore/TextParsing.swift:15-17 | Sources/CodexBarCore/TextParsing.swift:78-80 — there are 11 copies across 7 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 11 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:63` calls `parseCodeReviewRemainingPercent`, `replacingOccurrences` and `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:190` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 6) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:245— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:245-250 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:258-263 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:274-279 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:171-176 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:184-189 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:200-205 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 6) Sources/CodexBar/Providers/Codex/CodexHistoryOwnership.swift:135— Sources/CodexBar/Providers/Codex/CodexHistoryOwnership.swift:135-140 | Sources/CodexBar/Providers/Cursor/CursorLoginAccountSelector.swift:98-103 | Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSnapshotSelection.swift:31-36 | Sources/CodexBarCore/Providers/Codex/CodexVisibleAccountProjection.swift:158-163 | Sources/CodexBarCore/Providers/Codex/CodexVisibleAccountProjection.swift:359-364 | Sources/CodexBarCore/UsageFetcher.swift:1563-1568 — there are 6 copies across 5 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 6 sites; resolving a subset leaves the remainder to drift apart.
Off the main sequence: AdaptiveRefreshCore — AdaptiveRefreshCore: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: CodexBarCore — CodexBarCore: abstractness 0.02, instability 0.17, distance 0.82 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
Duplicated block (77 lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/bifrost.js:276— Sources/CodexBarCore/Resources/Plugins/bifrost.js:276 · Sources/CodexBarCore/Resources/Plugins/bifrost.ts:237 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (77 lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/devpass.js:36— Sources/CodexBarCore/Resources/Plugins/devpass.js:36 · Sources/CodexBarCore/Resources/Plugins/devpass.ts:8 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Complex function fetchUsage (cyclomatic 44, cognitive 60) REDACTED:11— fetchUsage has cyclomatic complexity 44 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 44, cognitive 60) REDACTED:11— fetchUsage has cyclomatic complexity 44 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 39, cognitive 53) Sources/CodexBarCore/Resources/Plugins/qwencloud-team.ts:9— fetchUsage has cyclomatic complexity 39 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 39, cognitive 53) Sources/CodexBarCore/Resources/Plugins/zed.js:12— fetchUsage has cyclomatic complexity 39 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 37, cognitive 32) Sources/CodexBarCore/Resources/Plugins/aixy.js:111— (anonymous) has cyclomatic complexity 37 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 37, cognitive 32) Sources/CodexBarCore/Resources/Plugins/aixy.ts:90— (anonymous) has cyclomatic complexity 37 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 32, cognitive 48) Sources/CodexBarCore/Resources/Plugins/replicate.js:29— fetchUsage has cyclomatic complexity 32 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 32, cognitive 48) Sources/CodexBarCore/Resources/Plugins/replicate.ts:8— fetchUsage has cyclomatic complexity 32 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 32, cognitive 46) Sources/CodexBarCore/Resources/Plugins/hyper.js:32— fetchUsage has cyclomatic complexity 32 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 32, cognitive 46) Sources/CodexBarCore/Resources/Plugins/hyper.ts:11— fetchUsage has cyclomatic complexity 32 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Dead file (~314 LoC) Sources/CodexBarCore/Resources/Plugins/workbuddy.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~314 LoC) Sources/CodexBarCore/Resources/Plugins/zoommate.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~259 LoC) Sources/CodexBarCore/Resources/Plugins/aixy.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~259 LoC) Sources/CodexBarCore/Resources/Plugins/muse.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~237 LoC) Sources/CodexBarCore/Resources/Plugins/claudeplatform.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~237 LoC) Sources/CodexBarCore/Resources/Plugins/claudeplatform.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
fetchUsage (cyclomatic 135) Sources/CodexBarCore/Resources/Plugins/openrouter.js:24— fetchUsage has cyclomatic complexity 135 (threshold 15). Of this number, 116 points are the body's own statements and 19 belong to 9 function items inside it that branch. 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.
ProviderPluginManifest.init (cyclomatic 86) Sources/CodexBarCore/Plugins/ProviderPluginManifest.swift:133— ProviderPluginManifest.init has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TTYCommandRunner.run (cyclomatic 83) Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:459— TTYCommandRunner.run has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (TTYCommandRunner.run::processNonCodexChunk) 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.
fetchUsage (cyclomatic 79) Sources/CodexBarCore/Resources/Plugins/sub2api.js:10— fetchUsage has cyclomatic complexity 79 (threshold 15). Of this number, 52 points are the body's own statements and 27 belong to 9 function items inside it that branch. 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.
fetchUsage (cyclomatic 76) Sources/CodexBarCore/Resources/Plugins/poe.js:15— fetchUsage has cyclomatic complexity 76 (threshold 15). Of this number, 57 points are the body's own statements and 19 belong to 17 function items inside it that branch. 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.
fetchUsage (cyclomatic 75) Sources/CodexBarCore/Resources/Plugins/zai.js:24— fetchUsage 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.
UsageStore.limitResetDetectorTransition (cyclomatic 68) Sources/CodexBar/UsageStore/UsageStore+LimitResetCelebration.swift:301— UsageStore.limitResetDetectorTransition has cyclomatic complexity 68 (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.
applyProviderPluginPrelude (cyclomatic 68) REDACTED:2— applyProviderPluginPrelude has cyclomatic complexity 68 (threshold 15). Most of this is not in the body itself: 1 of the 68 points is its own statement and the rest belongs to 52 function items inside it that branch (formatNumber, postOptions, a function literal at line 105, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
fetchUsage (cyclomatic 67) REDACTED:11— fetchUsage has cyclomatic complexity 67 (threshold 15). Of this number, 43 points are the body's own statements and 24 belong to 8 function items inside it that branch. 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.
fetchUsage (cyclomatic 62) Sources/CodexBarCore/Resources/Plugins/openai.js:14— fetchUsage has cyclomatic complexity 62 (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.
ProviderPluginCookiePolicy.init (cyclomatic 61) Sources/CodexBarCore/Plugins/ProviderPluginCookiePolicy.swift:42— ProviderPluginCookiePolicy.init has cyclomatic complexity 61 (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.
fetchUsage (cyclomatic 60) Sources/CodexBarCore/Resources/Plugins/deepgram.js:11— fetchUsage has cyclomatic complexity 60 (threshold 15). Of this number, 25 points are the body's own statements and 35 belong to 8 function items inside it that branch. 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.
CostUsageFetcher.loadTokenResult (cyclomatic 58) Sources/CodexBarCore/CostUsageFetcher.swift:493— CostUsageFetcher.loadTokenResult has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AntigravityOAuthConfig.binaryClient (cyclomatic 56) Sources/CodexBarCore/Providers/Antigravity/AntigravityOAuthCredentialsStore.swift:322— AntigravityOAuthConfig.binaryClient has cyclomatic complexity 56 (threshold 15). Of this number, 50 points are the body's own statements and 6 belong to one function item inside it that branches. 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.
Usage.rows (cyclomatic 55) Integrations/Linux/Shared/Usage.js:39— Usage.rows has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 5 of the 55 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 44, 57, 61, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
fetchUsage (cyclomatic 52) Sources/CodexBarCore/Resources/Plugins/t3chat.js:12— fetchUsage has cyclomatic complexity 52 (threshold 15). Of this number, 41 points are the body's own statements and 11 belong to 4 function items inside it that branch. 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.
fetchUsage (cyclomatic 50) Sources/CodexBarCore/Resources/Plugins/zed.js:12— fetchUsage has cyclomatic complexity 50 (threshold 15). Of this number, 39 points are the body's own statements and 11 belong to 6 function items inside it that branch. 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.
MenuBarLayoutRenderer.renderUncached (cyclomatic 49) Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:431— MenuBarLayoutRenderer.renderUncached has cyclomatic complexity 49 (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.
UsageStore.menuCardInput (cyclomatic 49) Sources/CodexBar/UsageStore/UsageStore+MenuCardModel.swift:55— UsageStore.menuCardInput has cyclomatic complexity 49 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatusItemController.applyIcon (cyclomatic 48) Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:361— StatusItemController.applyIcon has cyclomatic complexity 48 (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.
fetchUsage (cyclomatic 48) REDACTED:11— fetchUsage has cyclomatic complexity 48 (threshold 15). Of this number, 39 points are the body's own statements and 9 belong to 3 function items inside it that branch. 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.
ClaudeCLISession.captureExclusive (cyclomatic 47) Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:145— ClaudeCLISession.captureExclusive has cyclomatic complexity 47 (threshold 15). Of this number, 46 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
UsageStore.handleProviderFetchFailure (cyclomatic 46) Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:1305— UsageStore.handleProviderFetchFailure has cyclomatic complexity 46 (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.
fetchUsage (cyclomatic 46) REDACTED:8— fetchUsage has cyclomatic complexity 46 (threshold 15). Of this number, 21 points are the body's own statements and 25 belong to 14 function items inside it that branch. 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.
StatusItemController.populateMenu (cyclomatic 45) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:222— StatusItemController.populateMenu has cyclomatic complexity 45 (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.
fetchUsage (cyclomatic 44) REDACTED:10— fetchUsage has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
fetchUsage (cyclomatic 42) Sources/CodexBarCore/Resources/Plugins/clawrouter.js:16— fetchUsage has cyclomatic complexity 42 (threshold 15). Of this number, 30 points are the body's own statements and 12 belong to 8 function items inside it that branch. 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.
CostUsageFetcher.loadCachedCodexTokenSnapshotResult (cyclomatic 41) Sources/CodexBarCore/CostUsageFetcher.swift:1418— CostUsageFetcher.loadCachedCodexTokenSnapshotResult 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.
PiSessionCostScanner.loadDailyReportResultCancellable (cyclomatic 41) Sources/CodexBarCore/PiSessionCostScanner.swift:155— PiSessionCostScanner.loadDailyReportResultCancellable 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.
fetchUsage (cyclomatic 41) Sources/CodexBarCore/Resources/Plugins/perplexity.js:8— fetchUsage 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.
CodexCLISession.captureStatus (cyclomatic 40) Sources/CodexBarCore/Providers/Codex/CodexCLISession.swift:52— CodexCLISession.captureStatus has cyclomatic complexity 40 (threshold 15). Of this number, 39 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
CodexRequestLedger.load (cyclomatic 39) Sources/CodexBarCore/Providers/Codex/CodexRequestLedger.swift:111— CodexRequestLedger.load has cyclomatic complexity 39 (threshold 15). Of this number, 37 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
fetchUsage (cyclomatic 39) Sources/CodexBarCore/Resources/Plugins/opendesign.js:14— fetchUsage has cyclomatic complexity 39 (threshold 15). Of this number, 16 points are the body's own statements and 23 belong to 8 function items inside it that branch. 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.
fetchUsage (cyclomatic 38) REDACTED:15— fetchUsage has cyclomatic complexity 38 (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.
install.main (cyclomatic 37) Integrations/Linux/install.py:61— install.main 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.
fetchUsage (cyclomatic 37) Sources/CodexBarCore/Resources/Plugins/manus.js:8— fetchUsage has cyclomatic complexity 37 (threshold 15). Of this number, 25 points are the body's own statements and 12 belong to 5 function items inside it that branch. 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.
MenuBarLayoutRenderer.renderItem (cyclomatic 36) Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:754— MenuBarLayoutRenderer.renderItem 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.
SpendDashboardModel.modelSummary (cyclomatic 36) Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:42— SpendDashboardModel.modelSummary 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.
CodexBarCLI.topCostModelLines (cyclomatic 36) Sources/CodexBarCLI/CLICostCommand.swift:363— CodexBarCLI.topCostModelLines 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.
AlibabaTokenPlanCLIUsageParser.teamUsage (cyclomatic 36) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCLIUsageFetcher.swift:81— AlibabaTokenPlanCLIUsageParser.teamUsage has cyclomatic complexity 36 (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.
OpenAIDashboardFetcher.collectPageSnapshot (cyclomatic 34) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher+PageScrape.swift:34— OpenAIDashboardFetcher.collectPageSnapshot has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AmpUsageParser.parse (cyclomatic 34) Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift:20— AmpUsageParser.parse has cyclomatic complexity 34 (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.
fetchUsage (cyclomatic 34) REDACTED:11— fetchUsage has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 14 of the 34 points are its own statements and the rest belongs to 7 function items inside it that branch (get, amount, date, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SessionEquivalentBurnEstimator.estimate (cyclomatic 33) Sources/CodexBar/SessionEquivalentForecast.swift:172— SessionEquivalentBurnEstimator.estimate 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.
UsageStore.applyProviderRefreshSuccess (cyclomatic 33) Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:631— UsageStore.applyProviderRefreshSuccess has cyclomatic complexity 33 (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.
Model.extraRateWindowMetrics (cyclomatic 33) Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:948— Model.extraRateWindowMetrics has cyclomatic complexity 33 (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.
MuseLocalUsageReader.parseLine (cyclomatic 33) Sources/CodexBarCore/Providers/Muse/MuseLocalUsageReader.swift:496— MuseLocalUsageReader.parseLine has cyclomatic complexity 33 (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.
fetchUsage (cyclomatic 33) Sources/CodexBarCore/Resources/Plugins/traecn.js:9— fetchUsage has cyclomatic complexity 33 (threshold 15). Of this number, 19 points are the body's own statements and 14 belong to 7 function items inside it that branch. 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.
CostHistoryChartMenuView.body (cyclomatic 32) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:119— CostHistoryChartMenuView.body 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.
UsageStore.reconcileClaudeRefreshAfterFetch (cyclomatic 32) Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:493— UsageStore.reconcileClaudeRefreshAfterFetch has cyclomatic complexity 32 (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.
CodexWeeklyResetConfirmation.evaluateDelayedCandidateCreation (cyclomatic 32) Sources/CodexBar/Providers/Codex/CodexWeeklyResetConfirmation.swift:234— CodexWeeklyResetConfirmation.evaluateDelayedCandidateCreation has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CodexWeeklyResetConfirmation.evaluateDelayedCandidate (cyclomatic 32) Sources/CodexBar/Providers/Codex/CodexWeeklyResetConfirmation.swift:295— CodexWeeklyResetConfirmation.evaluateDelayedCandidate has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CodexBarConfigValidator.validateProvider (cyclomatic 32) Sources/CodexBarCore/Config/CodexBarConfigValidation.swift:112— CodexBarConfigValidator.validateProvider has cyclomatic complexity 32 (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.
SpendDashboardModel.buildCurrencyGroup (cyclomatic 31) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:583— SpendDashboardModel.buildCurrencyGroup has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ProviderSettingsTokenAccountsRowView.body (cyclomatic 30) Sources/CodexBar/Settings/PreferencesProviderSettingsRows.swift:248— ProviderSettingsTokenAccountsRowView.body has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UsageStore.handleSessionQuotaTransition (cyclomatic 30) Sources/CodexBar/UsageStore/UsageStore+SessionQuotaTransition.swift:7— UsageStore.handleSessionQuotaTransition has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UsageStore.refreshCodexVisibleAccountsForMenu (cyclomatic 30) Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:150— UsageStore.refreshCodexVisibleAccountsForMenu has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Model.secondaryMetric (cyclomatic 30) Sources/CodexBar/Menu/MenuCardView.swift:1397— Model.secondaryMetric has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AlibabaCodingPlanUsageFetcher.parseUsageSnapshot (cyclomatic 30) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:443— AlibabaCodingPlanUsageFetcher.parseUsageSnapshot has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GrokWebBillingFetcher.parseGRPCWebResponse (cyclomatic 30) Sources/CodexBarCore/Providers/Grok/GrokWebBillingFetcher.swift:312— GrokWebBillingFetcher.parseGRPCWebResponse has cyclomatic complexity 30 (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.
IconRenderer.makeIcon (cyclomatic 29) Sources/CodexBar/IconRenderer.swift:142— IconRenderer.makeIcon 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. This shape REPEATS in the file: one other method here (IconRenderer.makeIcon::drawBar) 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.
SessionQuotaTransitionReducer.evaluate (cyclomatic 29) Sources/CodexBar/SessionQuotaNotifications.swift:155— SessionQuotaTransitionReducer.evaluate 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.
MenuBarLayoutPersistence.preferredLibrary (cyclomatic 29) Sources/CodexBar/Menu/MenuBarLayout.swift:1414— MenuBarLayoutPersistence.preferredLibrary 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.
UsageMenuCardView.body (cyclomatic 29) Sources/CodexBar/Menu/MenuCardView.swift:225— UsageMenuCardView.body 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.
MenuDescriptor.usageSection (cyclomatic 29) Sources/CodexBar/Menu/MenuDescriptor.swift:253— MenuDescriptor.usageSection 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.
MenuDescriptor.accountEntries (cyclomatic 29) Sources/CodexBar/Menu/MenuDescriptor.swift:437— MenuDescriptor.accountEntries 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.
StatusItemController.menuBarDisplayText (cyclomatic 29) Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:774— StatusItemController.menuBarDisplayText has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
UsageStore.importOpenAIDashboardCookiesIfNeeded (cyclomatic 29) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:1182— UsageStore.importOpenAIDashboardCookiesIfNeeded 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.
CodexWeeklyResetConfirmation.confirmationDecision (cyclomatic 29) Sources/CodexBar/Providers/Codex/CodexWeeklyResetConfirmation.swift:155— CodexWeeklyResetConfirmation.confirmationDecision has cyclomatic complexity 29 (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.
JavaScriptCoreProviderPluginEngine.makeContext (cyclomatic 29) Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:639— JavaScriptCoreProviderPluginEngine.makeContext 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.
QoderCookieRouting.preprocessedCurlShellText (cyclomatic 29) Sources/CodexBarCore/Providers/Qoder/QoderCookieRouting.swift:399— QoderCookieRouting.preprocessedCurlShellText 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.
fetchUsage (cyclomatic 29) REDACTED:8— fetchUsage has cyclomatic complexity 29 (threshold 15). Of this number, 17 points are the body's own statements and 12 belong to 5 function items inside it that branch. 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.
HistoricalUsageHistoryStore.backfillCodexWeeklyFromUsageBreakdown (cyclomatic 28) Sources/CodexBar/HistoricalUsagePace.swift:154— HistoricalUsageHistoryStore.backfillCodexWeeklyFromUsageBreakdown 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.
UsageStore.runCodexCostCatchUp (cyclomatic 28) Sources/CodexBar/Providers/Codex/UsageStore+CodexCostCatchUp.swift:107— UsageStore.runCodexCostCatchUp 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.
SignatureReader.slice (cyclomatic 28) Sources/CodexBarCore/CodexLaunchPreflight+SignatureIdentity.swift:89— SignatureReader.slice 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.
PiFamilySessionScanner.costSessionRoots (cyclomatic 28) Sources/CodexBarCore/PiFamilySessionScanner.swift:391— PiFamilySessionScanner.costSessionRoots has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
Model.metrics (cyclomatic 28) Sources/CodexBar/Menu/MenuCardView.swift:1220— Model.metrics has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProviderPluginCookieBroker.advance (cyclomatic 28) Sources/CodexBarCore/Plugins/ProviderPluginCookieBroker.swift:301— ProviderPluginCookieBroker.advance 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.
ProviderPluginHTTPResponse.request (cyclomatic 28) Sources/CodexBarCore/Plugins/ProviderPluginHTTPResponse.swift:227— ProviderPluginHTTPResponse.request 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.
Lexer.number (cyclomatic 28) Sources/CodexBarCore/Providers/Antigravity/AntigravityJSONLObject.swift:116— Lexer.number has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
CodexRequestLedger.validate (cyclomatic 28) Sources/CodexBarCore/Providers/Codex/CodexRequestLedger.swift:71— CodexRequestLedger.validate has cyclomatic complexity 28 (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.
CursorStatusProbe.resolveSession (cyclomatic 28) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe+SessionResolution.swift:37— CursorStatusProbe.resolveSession has cyclomatic complexity 28 (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.
CursorStatusProbe.parseUsageSummary (cyclomatic 28) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe+UsageSummary.swift:5— CursorStatusProbe.parseUsageSummary has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
KiroUsageSnapshot.toUsageSnapshot (cyclomatic 28) Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:108— KiroUsageSnapshot.toUsageSnapshot has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SpendDashboardController.handleBuiltRequest (cyclomatic 27) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:1440— SpendDashboardController.handleBuiltRequest has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SpendDashboardModel.projectRows (cyclomatic 27) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:832— SpendDashboardModel.projectRows has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UsageStore.resolvePlanUtilizationAccountKey (cyclomatic 27) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:1077— UsageStore.resolvePlanUtilizationAccountKey has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UsageStore.refreshTokenUsage (cyclomatic 27) Sources/CodexBar/UsageStore/UsageStore.swift:1428— UsageStore.refreshTokenUsage has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PiSessionCostScanner.parsePiSessionFile (cyclomatic 27) Sources/CodexBarCore/PiSessionCostScanner.swift:832— PiSessionCostScanner.parsePiSessionFile has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
Model.costHistoryInlineDashboard (cyclomatic 27) Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:272— Model.costHistoryInlineDashboard 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.
KiloUsageFetcher.creditFields (cyclomatic 27) Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:579— KiloUsageFetcher.creditFields has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OllamaUsageParser.looksSignedOut (cyclomatic 27) Sources/CodexBarCore/Providers/Ollama/OllamaUsageParser.swift:216— OllamaUsageParser.looksSignedOut has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CodexHistoricalPaceEvaluator.evaluate (cyclomatic 26) Sources/CodexBar/HistoricalUsagePace.swift:758— CodexHistoricalPaceEvaluator.evaluate has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SpendDashboardSource.makeRequest (cyclomatic 26) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:223— SpendDashboardSource.makeRequest 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.
StatusItemController.addActionableSections (cyclomatic 26) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:852— StatusItemController.addActionableSections 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.
UsageStore.shouldExcludeFromHighestUsage (cyclomatic 26) Sources/CodexBar/UsageStore/UsageStore+HighestUsage.swift:92— UsageStore.shouldExcludeFromHighestUsage 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.
UsageStore.codexWeeklyResetDecision (cyclomatic 26) Sources/CodexBar/UsageStore/UsageStore+LimitResetCelebration.swift:461— UsageStore.codexWeeklyResetDecision has cyclomatic complexity 26 (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.
UsageStore.handleQuotaWarningTransitions (cyclomatic 26) Sources/CodexBar/UsageStore/UsageStore+QuotaWarnings.swift:36— UsageStore.handleQuotaWarningTransitions has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UsageStore.makeWidgetEntry (cyclomatic 26) Sources/CodexBar/UsageStore/UsageStore+WidgetSnapshot.swift:256— UsageStore.makeWidgetEntry has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CodexBarCLI.runStandardCost (cyclomatic 26) Sources/CodexBarCLI/CLICostCommand.swift:18— CodexBarCLI.runStandardCost 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.
SignatureReader.validate (cyclomatic 26) Sources/CodexBarCore/CodexLaunchPreflight+SignatureIdentity.swift:131— SignatureReader.validate 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.
PiFamilySessionScanner.retainedSettingsRootResolution (cyclomatic 26) Sources/CodexBarCore/PiFamilySessionScanner.swift:756— PiFamilySessionScanner.retainedSettingsRootResolution 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.
CopilotBudgetWebFetcher.normalizedBillingIdentifier (cyclomatic 26) Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:651— CopilotBudgetWebFetcher.normalizedBillingIdentifier has cyclomatic complexity 26 (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.
GrokLocalSessionScanner.summarize (cyclomatic 26) Sources/CodexBarCore/Providers/Grok/GrokLocalSessionScanner.swift:81— GrokLocalSessionScanner.summarize 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.
OpenCodeGoLocalUsageFetchStrategy.snapshotWithoutCLILogin (cyclomatic 26) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift:256— OpenCodeGoLocalUsageFetchStrategy.snapshotWithoutCLILogin 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.
Repository.loadRecord (cyclomatic 26) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:336— Repository.loadRecord 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.
BurnTheme.init (cyclomatic 26) Sources/CodexBarWidget/BurnDownWidgetViews.swift:550— BurnTheme.init 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.
chutes.chutesQuota (cyclomatic 26) Sources/CodexBarCore/Resources/Plugins/chutes.ts:149— chutes.chutesQuota has cyclomatic complexity 26 (threshold 15). Of this number, 18 points are the body's own statements and 8 belong to 2 function items inside it that branch. 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.
MenuBarLayoutRenderer.removeDuplicateBalanceResets (cyclomatic 25) Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:592— MenuBarLayoutRenderer.removeDuplicateBalanceResets has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
StatusItemController.startManualRefresh (cyclomatic 25) Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:180— StatusItemController.startManualRefresh has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatusItemController.switcherWeeklyMetricPercent (cyclomatic 25) Sources/CodexBar/StatusItem/StatusItemController+SwitcherMetrics.swift:48— StatusItemController.switcherWeeklyMetricPercent has cyclomatic complexity 25 (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.
UsageStore.hydrateCachedTokenSnapshots (cyclomatic 25) Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift:393— UsageStore.hydrateCachedTokenSnapshots has cyclomatic complexity 25 (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.
UsageStore.debugLog (cyclomatic 25) Sources/CodexBar/UsageStore/UsageStore.swift:1033— UsageStore.debugLog 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.
UsageStore.refreshCreditsIfNeeded (cyclomatic 25) Sources/CodexBar/Providers/Codex/UsageStore+CodexRefresh.swift:124— UsageStore.refreshCreditsIfNeeded 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.
CodexBarCLI.main (cyclomatic 25) Sources/CodexBarCLI/CLIEntry.swift:20— CodexBarCLI.main has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AntigravityLocalReader.readDatabase (cyclomatic 25) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSQLite.swift:133— AntigravityLocalReader.readDatabase 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.
BurnDownLayout.body (cyclomatic 25) Sources/CodexBarWidget/BurnDownWidgetViews.swift:66— BurnDownLayout.body has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MenuBarLayoutBalanceResolver.balance (cyclomatic 24) Sources/CodexBar/Menu/MenuBarLayout.swift:746— MenuBarLayoutBalanceResolver.balance 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.
SettingsStore.recoverLegacyCredentials (cyclomatic 24) Sources/CodexBar/Settings/SettingsStore+Config.swift:48— SettingsStore.recoverLegacyCredentials has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
UsageStore.recordPlanUtilizationHistorySample (cyclomatic 24) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:210— UsageStore.recordPlanUtilizationHistorySample has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UsageStore.planUtilizationSeriesSamples (cyclomatic 24) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:561— UsageStore.planUtilizationSeriesSamples has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 belong to 2 function items inside it that branch. 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.
UsageStore.resolvedClaudeOAuthHistoryOwner (cyclomatic 24) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:998— UsageStore.resolvedClaudeOAuthHistoryOwner 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.
UsageStore.refreshSpendDashboardTokenUsageNow (cyclomatic 24) Sources/CodexBar/UsageStore/UsageStore+SpendDashboardTokenCost.swift:70— UsageStore.refreshSpendDashboardTokenUsageNow 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.
CodexBarCLI.runCodexIdentifiedUsage (cyclomatic 24) Sources/CodexBarCLI/CLICodexIdentifiedUsage.swift:27— CodexBarCLI.runCodexIdentifiedUsage has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CodexThreadMetadataReader.decodeMultilineBasicString (cyclomatic 24) Sources/CodexBarCore/CodexThreadMetadataReader.swift:373— CodexThreadMetadataReader.decodeMultilineBasicString has cyclomatic complexity 24 (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.
CostUsageFetcher.loadLocalTokenScanResult (cyclomatic 24) Sources/CodexBarCore/CostUsageFetcher.swift:917— CostUsageFetcher.loadLocalTokenScanResult 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.
Model.tokenUsageSection (cyclomatic 24) Sources/CodexBar/Menu/MenuCardView+Costs.swift:208— Model.tokenUsageSection has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Model.providerCostSection (cyclomatic 24) Sources/CodexBar/Menu/MenuCardView+Costs.swift:469— Model.providerCostSection has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
QuickJSProviderPluginEngine.handleHostCall (cyclomatic 24) Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:544— QuickJSProviderPluginEngine.handleHostCall has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ProviderDiagnosticFetchAttempt.errorCategoryLabel (cyclomatic 24) Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift:328— ProviderDiagnosticFetchAttempt.errorCategoryLabel has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AmpUsageSnapshot.toUsageSnapshot (cyclomatic 24) Sources/CodexBarCore/Providers/Amp/AmpUsageSnapshot.swift:91— AmpUsageSnapshot.toUsageSnapshot has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AntigravityLocalReader.aggregate (cyclomatic 24) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalReader.swift:187— AntigravityLocalReader.aggregate 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.
ManagedCodexAccountCredentialResolver.resolve (cyclomatic 24) Sources/CodexBarCore/Providers/Codex/ManagedCodexAccountCredentialResolver.swift:155— ManagedCodexAccountCredentialResolver.resolve has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
KimiDesktopSessionDiscovery.accessToken (cyclomatic 24) Sources/CodexBarCore/Providers/Kimi/KimiDesktopSessionDiscovery.swift:55— KimiDesktopSessionDiscovery.accessToken has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MiniMaxLocalStorageImporter.readLocalStorage (cyclomatic 24) Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:142— MiniMaxLocalStorageImporter.readLocalStorage 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.
MistralUsageSnapshot.toCostUsageTokenSnapshot (cyclomatic 24) Sources/CodexBarCore/Providers/Mistral/MistralModels.swift:264— MistralUsageSnapshot.toCostUsageTokenSnapshot has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
OpenCodeLocalHistoryAdapter.runPass (cyclomatic 24) Sources/CodexBarCore/Providers/OpenCode/OpenCodeLocalHistoryAdapter.swift:206— OpenCodeLocalHistoryAdapter.runPass has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SessionEquivalentBurnEstimator.normalizedBurn (cyclomatic 23) Sources/CodexBar/SessionEquivalentForecast.swift:286— SessionEquivalentBurnEstimator.normalizedBurn has cyclomatic complexity 23 (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.
StatusItemController.scheduleMenuBarCountdownRefreshIfNeeded (cyclomatic 23) Sources/CodexBar/StatusItem/StatusItemController+CountdownRefresh.swift:7— StatusItemController.scheduleMenuBarCountdownRefreshIfNeeded 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.
UsageStore.runRefresh (cyclomatic 23) Sources/CodexBar/UsageStore/UsageStore.swift:755— UsageStore.runRefresh 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.
UsageStore.refreshProviderPass (cyclomatic 23) Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:294— UsageStore.refreshProviderPass 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.
UsageStore.codexOutcomeAdmittedForPublication (cyclomatic 23) Sources/CodexBar/Providers/Codex/UsageStore+CodexWeeklyResetConfirmation.swift:31— UsageStore.codexOutcomeAdmittedForPublication has cyclomatic complexity 23 (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.
UsageStore.runSpendDashboardCodexCostCatchUp (cyclomatic 23) Sources/CodexBar/Providers/Codex/UsageStore+SpendDashboardCodexCostCatchUp.swift:143— UsageStore.runSpendDashboardCodexCostCatchUp has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
CodexWeeklyResetConfirmation.initialDecision (cyclomatic 23) Sources/CodexBar/Providers/Codex/CodexWeeklyResetConfirmation.swift:90— CodexWeeklyResetConfirmation.initialDecision 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.
CodexBarCLI.fetchUsageOutput (cyclomatic 23) Sources/CodexBarCLI/CLIUsageCommand.swift:423— CodexBarCLI.fetchUsageOutput 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.
QuotaSnapshots.init (cyclomatic 23) Sources/CodexBarCore/CopilotUsageModels.swift:233— QuotaSnapshots.init 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.
KeychainCacheStore.storeResult (cyclomatic 23) Sources/CodexBarCore/KeychainCacheStore.swift:171— KeychainCacheStore.storeResult 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.
PiSessionCostScanner.appendingPreviousSessionRoots (cyclomatic 23) Sources/CodexBarCore/PiSessionCostScanner.swift:496— PiSessionCostScanner.appendingPreviousSessionRoots has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
SessionToolActivityParser.operation (cyclomatic 23) Sources/CodexBarCore/SessionToolActivityParser.swift:13— SessionToolActivityParser.operation has cyclomatic complexity 23 (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.
WidgetExtensionRecovery.launch (cyclomatic 23) Sources/CodexBarCore/WidgetExtensionRecovery.swift:40— WidgetExtensionRecovery.launch has cyclomatic complexity 23 (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.
AntigravityLocalReader.readStepTimestamps (cyclomatic 23) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSQLite.swift:322— AntigravityLocalReader.readStepTimestamps 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.
ClaudeStatusProbe.exactLocalOccurrences (cyclomatic 23) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:1130— ClaudeStatusProbe.exactLocalOccurrences has cyclomatic complexity 23 (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.
DeepSeekPlatformTokenImporter.resolve (cyclomatic 23) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekPlatformTokenImporter.swift:139— DeepSeekPlatformTokenImporter.resolve 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.
KiroStatusProbe.parse (cyclomatic 23) Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:873— KiroStatusProbe.parse 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.
MiniMaxUsageParser.parseCodingPlanRemains (cyclomatic 23) Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:788— MiniMaxUsageParser.parseCodingPlanRemains 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.
ClaudeOAuthCredentialsStore.loadCodexBarOAuthKeychainCache (cyclomatic 23) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:2635— ClaudeOAuthCredentialsStore.loadCodexBarOAuthKeychainCache 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.
Repository.hasCachedCredentials (cyclomatic 23) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:900— Repository.hasCachedCredentials has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
Recovery.syncFromClaudeKeychainWithoutPrompt (cyclomatic 23) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1232— Recovery.syncFromClaudeKeychainWithoutPrompt has cyclomatic complexity 23 (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.
fetchUsage (cyclomatic 23) Sources/CodexBarCore/Resources/Plugins/xapi.js:15— fetchUsage has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (request, amount, invalid, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
QuotaBurndownModel.init (cyclomatic 22) Sources/CodexBar/QuotaBurndownModel.swift:17— QuotaBurndownModel.init has cyclomatic complexity 22 (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.
SpendDashboardModel.inputSummary (cyclomatic 22) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:737— SpendDashboardModel.inputSummary 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.
UsageStore.handleQuotaWarningTransition (cyclomatic 22) Sources/CodexBar/UsageStore/UsageStore+QuotaWarnings.swift:138— UsageStore.handleQuotaWarningTransition 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.
UsageStore.applySelectedOutcome (cyclomatic 22) Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:1467— UsageStore.applySelectedOutcome 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.
UsageStore.widgetAccounts (cyclomatic 22) Sources/CodexBar/UsageStore/UsageStore+WidgetAccounts.swift:42— UsageStore.widgetAccounts 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.
UsageStore.switchClaudeSwapAccount (cyclomatic 22) Sources/CodexBar/Providers/Claude/UsageStore+ClaudeSwapRefresh.swift:181— UsageStore.switchClaudeSwapAccount 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.
UsageStore.performOpenAIDashboardRefreshIfNeeded (cyclomatic 22) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:539— UsageStore.performOpenAIDashboardRefreshIfNeeded 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.
CodexBarCLI.handleServeRequest (cyclomatic 22) Sources/CodexBarCLI/CLIServeCommand.swift:858— CodexBarCLI.handleServeRequest has cyclomatic complexity 22 (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.
CostUsageTokenSnapshot.quotaHourlyResidualSlices (cyclomatic 22) Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:429— CostUsageTokenSnapshot.quotaHourlyResidualSlices has cyclomatic complexity 22 (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.
PiSessionCostScanner.loadCachedDailyReportResult (cyclomatic 22) Sources/CodexBarCore/PiSessionCostScanner.swift:343— PiSessionCostScanner.loadCachedDailyReportResult 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.
AntigravityCLISession.ensureStartedLocked (cyclomatic 22) Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:498— AntigravityCLISession.ensureStartedLocked 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.
CursorLocalCSVReader.parseFile (cyclomatic 22) Sources/CodexBarCore/Providers/Cursor/CursorLocalCSVReader.swift:46— CursorLocalCSVReader.parseFile has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
KiroStatusProbe.runCommand (cyclomatic 22) Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:1176— KiroStatusProbe.runCommand 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.
Recovery.syncWithClaudeKeychainIfChanged (cyclomatic 22) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1075— Recovery.syncWithClaudeKeychainIfChanged 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.
Recovery.repairFromClaudeKeychainWithoutPromptIfAllowed (cyclomatic 22) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1152— Recovery.repairFromClaudeKeychainWithoutPromptIfAllowed 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.
OneConsoleCookieRouting.redirectedRequest (cyclomatic 22) Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleCookieRouting.swift:31— OneConsoleCookieRouting.redirectedRequest has cyclomatic complexity 22 (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.
CombinedBurnRow.body (cyclomatic 22) Sources/CodexBarWidget/CombinedBurnDownWidgetViews.swift:141— CombinedBurnRow.body 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.
ReplayEngine.runDetailed (cyclomatic 21) Sources/AdaptiveReplayKit/ReplayEngine.swift:53— ReplayEngine.runDetailed 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.
SessionEquivalentForecast.make (cyclomatic 21) Sources/CodexBar/SessionEquivalentForecast.swift:40— SessionEquivalentForecast.make has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SpendDashboardPublication.coverageSources (cyclomatic 21) Sources/CodexBar/SpendDashboard/SpendDashboardPublication.swift:153— SpendDashboardPublication.coverageSources has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
StatusItemController.performStoreRefresh (cyclomatic 21) Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:74— StatusItemController.performStoreRefresh 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.
CloudSyncEngine.processEvent (cyclomatic 21) Sources/CodexBar/Sync/CloudSyncEngine.swift:829— CloudSyncEngine.processEvent 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.
CodexBarCLI.renderCostText (cyclomatic 21) Sources/CodexBarCLI/CLICostCommand.swift:191— CodexBarCLI.renderCostText has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CLIServeOperationCoordinator.sourceProduced (cyclomatic 21) Sources/CodexBarCLI/CLIServeOperationCoordinator.swift:484— CLIServeOperationCoordinator.sourceProduced 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.
CostUsageFetcher.codexBreakdownsWithMetadata (cyclomatic 21) Sources/CodexBarCore/CostUsageFetcher.swift:1058— CostUsageFetcher.codexBreakdownsWithMetadata has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
Model.hasCompatibleTrackedLayout (cyclomatic 21) Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:426— Model.hasCompatibleTrackedLayout has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProviderDiagnosticError.errorCategory (cyclomatic 21) Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift:369— ProviderDiagnosticError.errorCategory has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Lexer.object (cyclomatic 21) Sources/CodexBarCore/Providers/Antigravity/AntigravityJSONLObject.swift:34— Lexer.object 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.
AuggieCLIProbe.parse (cyclomatic 21) Sources/CodexBarCore/Providers/Augment/AuggieCLIProbe.swift:55— AuggieCLIProbe.parse 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.
ClaudeCLIScreen.applyCSI (cyclomatic 21) Sources/CodexBarCore/Providers/Claude/ClaudeCLIScreen.swift:86— ClaudeCLIScreen.applyCSI 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.
CursorStatusSnapshot.toUsageSnapshot (cyclomatic 21) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:448— CursorStatusSnapshot.toUsageSnapshot has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CursorStatusProbe.fetchWithCookieHeader (cyclomatic 21) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:1204— CursorStatusProbe.fetchWithCookieHeader 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.
DoubaoUsageFetcher.decodeArkcliUsage (cyclomatic 21) Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:504— DoubaoUsageFetcher.decodeArkcliUsage 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.
MuseLocalUsageReader.parseSessionLog (cyclomatic 21) Sources/CodexBarCore/Providers/Muse/MuseLocalUsageReader.swift:423— MuseLocalUsageReader.parseSessionLog has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to one function item inside it that branches. 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.
ClaudeOAuthRefreshFailureGate.reloadPersistedState (cyclomatic 21) REDACTED:374— ClaudeOAuthRefreshFailureGate.reloadPersistedState has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IconRenderer.makeIcon::drawBar (cyclomatic 20) Sources/CodexBar/IconRenderer.swift:168— IconRenderer.makeIcon::drawBar has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (IconRenderer.makeIcon) 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.
SpendDashboardController.startLoad (cyclomatic 20) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:1308— SpendDashboardController.startLoad 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.
StatusItemController.hydrateHostedSubviewMenuIfNeeded (cyclomatic 20) Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:91— StatusItemController.hydrateHostedSubviewMenuIfNeeded 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.
UsageStore.prepareLimitResetNotification (cyclomatic 20) Sources/CodexBar/LimitResetNotifications.swift:31— UsageStore.prepareLimitResetNotification 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.
UsageStore.shouldApplyCodexUsageResult (cyclomatic 20) Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:263— UsageStore.shouldApplyCodexUsageResult 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.
UsageStore.applyOpenAIDashboardAuthorityDecision (cyclomatic 20) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:231— UsageStore.applyOpenAIDashboardAuthorityDecision 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.
CLIClaudeSwapText.sanitize (cyclomatic 20) Sources/CodexBarCLI/CLIClaudeSwapCards.swift:24— CLIClaudeSwapText.sanitize 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.
CodexModelsAnalyticsBuilder.parityMismatches (cyclomatic 20) Sources/CodexBarCore/CodexModelsAnalyticsModels.swift:708— CodexModelsAnalyticsBuilder.parityMismatches 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.
CodexThreadMetadataReader.assignedProjectSessionIDs (cyclomatic 20) Sources/CodexBarCore/CodexThreadMetadataReader+Projects.swift:79— CodexThreadMetadataReader.assignedProjectSessionIDs 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.
CodexWorkspaceUsageSidecar.loadLatestSnapshot (cyclomatic 20) Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:73— CodexWorkspaceUsageSidecar.loadLatestSnapshot 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.
PiSessionCostScanner.buildReport (cyclomatic 20) Sources/CodexBarCore/PiSessionCostScanner+Aggregation.swift:17— PiSessionCostScanner.buildReport 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.
TailscaleStatusParser.parseHosts (cyclomatic 20) Sources/CodexBarCore/RemoteSessionFetcher.swift:29— TailscaleStatusParser.parseHosts 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.
UsagePace.weekly (cyclomatic 20) Sources/CodexBarCore/UsagePace.swift:60— UsagePace.weekly 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.
PreferencesDocument.validate (cyclomatic 20) Sources/CodexBarCore/Config/PreferencesDocument.swift:134— PreferencesDocument.validate 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.
OpenAIDashboardBrowserCookieImporter.importBestCookies (cyclomatic 20) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:119— OpenAIDashboardBrowserCookieImporter.importBestCookies 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.
TTYCommandRunner.run::processNonCodexChunk (cyclomatic 20) Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:743— TTYCommandRunner.run::processNonCodexChunk has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (TTYCommandRunner.run) 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.
AntigravityRemoteUsageFetcher.fetch (cyclomatic 20) Sources/CodexBarCore/Providers/Antigravity/AntigravityRemoteUsageFetcher.swift:100— AntigravityRemoteUsageFetcher.fetch 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.
FactoryStatusProbe.fetchWithCookies (cyclomatic 20) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:930— FactoryStatusProbe.fetchWithCookies has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
MiniMaxLocalStorageImporter.importAccessTokens (cyclomatic 20) Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:14— MiniMaxLocalStorageImporter.importAccessTokens 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.
QoderCookieRouting.httpRequestRoute (cyclomatic 20) Sources/CodexBarCore/Providers/Qoder/QoderCookieRouting.swift:75— QoderCookieRouting.httpRequestRoute 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.
OpenCodeSubscriptionParser.parseUsageNested (cyclomatic 20) Sources/CodexBarCore/Providers/Shared/OpenCodeSubscriptionParser.swift:65— OpenCodeSubscriptionParser.parseUsageNested 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.
Repository.loadFromClaudeKeychainWithPromptIfAllowed (cyclomatic 20) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:542— Repository.loadFromClaudeKeychainWithPromptIfAllowed 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.
ClaudeSubscriptionMetadataFetcher.fetchVerified (cyclomatic 20) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeSubscriptionMetadata.swift:113— ClaudeSubscriptionMetadataFetcher.fetchVerified has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to 2 function items inside it that branch. 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.
SessionUsagePresentation.sessions (cyclomatic 19) Sources/CodexBar/SessionUsagePresentation.swift:17— SessionUsagePresentation.sessions 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.
ShareStatsBuilder.make (cyclomatic 19) Sources/CodexBar/ShareStatsPayload.swift:216— ShareStatsBuilder.make has cyclomatic complexity 19 (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.
SpendProviderBreakdownRows.providerGroup (cyclomatic 19) Sources/CodexBar/SpendDashboard/SpendDashboardProviderBreakdown.swift:128— SpendProviderBreakdownRows.providerGroup 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.
ProviderSwitcherView.init (cyclomatic 19) Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:48— ProviderSwitcherView.init has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to one function item inside it that branches. 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.
StatusItemController.storedMenuBarLayoutPaceSignature (cyclomatic 19) Sources/CodexBar/StatusItem/StatusItemController+IconObservation.swift:226— StatusItemController.storedMenuBarLayoutPaceSignature 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.
StatusItemController.menuWillOpen (cyclomatic 19) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:66— StatusItemController.menuWillOpen 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.
StatusItemController.scheduleOpenMenuRefresh (cyclomatic 19) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1160— StatusItemController.scheduleOpenMenuRefresh 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.
UsageStore.handleCredentialOutcome (cyclomatic 19) Sources/CodexBar/UsageStore/UsageStore+CredentialNotifications.swift:50— UsageStore.handleCredentialOutcome 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.
UsageStore.scheduleCodexWeeklyResetFollowUp (cyclomatic 19) Sources/CodexBar/Providers/Codex/UsageStore+CodexWeeklyResetCandidatePersistence.swift:75— UsageStore.scheduleCodexWeeklyResetFollowUp has cyclomatic complexity 19 (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.
CodexResetCreditExpiryNotifier.postExpiringCreditsIfNeeded (cyclomatic 19) Sources/CodexBar/Providers/Codex/CodexResetCreditExpiryNotifier.swift:19— CodexResetCreditExpiryNotifier.postExpiringCreditsIfNeeded 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.
CodexWeeklyResetConfirmation.resetCreditEvidence (cyclomatic 19) Sources/CodexBar/Providers/Codex/CodexWeeklyResetConfirmation.swift:463— CodexWeeklyResetConfirmation.resetCreditEvidence has cyclomatic complexity 19 (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.
KiloProviderImplementation.settingsOrganizations (cyclomatic 19) Sources/CodexBar/Providers/Kilo/KiloProviderImplementation.swift:91— KiloProviderImplementation.settingsOrganizations has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 2 function items inside it that branch. 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.
CLICardsRenderer.renderCard (cyclomatic 19) Sources/CodexBarCLI/CLICardsRenderer.swift:296— CLICardsRenderer.renderCard 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.
CodexThreadCatalogReader.loadResult (cyclomatic 19) Sources/CodexBarCore/CodexThreadCatalogReader.swift:66— CodexThreadCatalogReader.loadResult 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.
CodexThreadMetadataReader.multilineQuote (cyclomatic 19) Sources/CodexBarCore/CodexThreadMetadataReader.swift:237— CodexThreadMetadataReader.multilineQuote 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.
CodexThreadMetadataReader.tomlString (cyclomatic 19) Sources/CodexBarCore/CodexThreadMetadataReader.swift:327— CodexThreadMetadataReader.tomlString 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.
CookieHeaderCache.currentObservationMatch (cyclomatic 19) Sources/CodexBarCore/CookieHeaderCache.swift:1396— CookieHeaderCache.currentObservationMatch 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.
KeychainAccessPreflight.evaluateDecryptACL (cyclomatic 19) Sources/CodexBarCore/KeychainAccessPreflight.swift:347— KeychainAccessPreflight.evaluateDecryptACL 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.
ShellCommandLocator.runShellCommand (cyclomatic 19) Sources/CodexBarCore/PathEnvironment.swift:889— ShellCommandLocator.runShellCommand 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.
PiFamilySessionScanner.ompSessionRootResolution (cyclomatic 19) Sources/CodexBarCore/PiFamilySessionScanner.swift:853— PiFamilySessionScanner.ompSessionRootResolution has cyclomatic complexity 19 (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.
PiFamilySessionScanner.records (cyclomatic 19) Sources/CodexBarCore/PiFamilySessionScanner.swift:1234— PiFamilySessionScanner.records 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.
PiSessionCostScanner.scanPiSessionFile (cyclomatic 19) Sources/CodexBarCore/PiSessionCostScanner.swift:745— PiSessionCostScanner.scanPiSessionFile has cyclomatic complexity 19 (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.
OpenAIDashboardParser.parseSignedInEmailFromClientBootstrap (cyclomatic 19) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:9— OpenAIDashboardParser.parseSignedInEmailFromClientBootstrap 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.
OpenAISubscription.fetch (cyclomatic 19) Sources/CodexBarCore/OpenAIWeb/OpenAISubscriptionMetadata.swift:94— OpenAISubscription.fetch 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.
ProviderIntentPayload.applying (cyclomatic 19) Sources/CodexBarCore/Sync/SyncModels.swift:77— ProviderIntentPayload.applying 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.
AntigravityLocalReader.consumeJSONLLine (cyclomatic 19) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalJSONL.swift:85— AntigravityLocalReader.consumeJSONLLine 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.
AntigravityCLIHTTPSFetchStrategy.tryWarmAgyFetch (cyclomatic 19) Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:350— AntigravityCLIHTTPSFetchStrategy.tryWarmAgyFetch 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.
ClaudeStatusProbe.extractUsageErrorJSON (cyclomatic 19) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:1332— ClaudeStatusProbe.extractUsageErrorJSON 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.
CodexDisplacedLivePreservationPlanner.makePlan (cyclomatic 19) Sources/CodexBarCore/Providers/Codex/CodexAccountPromotionPlanning.swift:43— CodexDisplacedLivePreservationPlanner.makePlan 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.
CodexDashboardAuthority.evaluate (cyclomatic 19) Sources/CodexBarCore/Providers/Codex/CodexDashboardAuthority.swift:170— CodexDashboardAuthority.evaluate 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.
CodexVisibleAccountProjection.make (cyclomatic 19) Sources/CodexBarCore/Providers/Codex/CodexVisibleAccountProjection.swift:206— CodexVisibleAccountProjection.make has cyclomatic complexity 19 (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.
GeminiStatusProbe.fetchViaAPI (cyclomatic 19) Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:268— GeminiStatusProbe.fetchViaAPI 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.
MistralSubscriptionBudgetParser.collectModels (cyclomatic 19) Sources/CodexBarCore/Providers/Mistral/MistralSubscriptionBudgetParser.swift:91— MistralSubscriptionBudgetParser.collectModels 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.
QoderCookieRouting.curlHeaderHostSites (cyclomatic 19) Sources/CodexBarCore/Providers/Qoder/QoderCookieRouting.swift:276— QoderCookieRouting.curlHeaderHostSites 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.
fetchUsage (cyclomatic 19) Sources/CodexBarCore/Resources/Plugins/exa.js:11— fetchUsage has cyclomatic complexity 19 (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.
ProviderDetailView.body (cyclomatic 18) Sources/CodexBar/Settings/PreferencesProviderDetailView.swift:135— ProviderDetailView.body 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.
SpendDashboardSource.load (cyclomatic 18) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:488— SpendDashboardSource.load 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.
SpendTrendChart.chart (cyclomatic 18) Sources/CodexBar/SpendDashboard/SpendDashboardTrendPanel.swift:272— SpendTrendChart.chart 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.
StatusItemController.addOverviewRows (cyclomatic 18) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:547— StatusItemController.addOverviewRows 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.
StatusItemController.addMenuCardSections (cyclomatic 18) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1292— StatusItemController.addMenuCardSections has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
StatusItemController.scheduleDeferredMenuInteractionRefreshIfNeeded (cyclomatic 18) Sources/CodexBar/StatusItem/StatusItemController+MenuInteractionRefresh.swift:112— StatusItemController.scheduleDeferredMenuInteractionRefreshIfNeeded 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.
StatusItemController.scheduleManualRefreshViewportRestore (cyclomatic 18) Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift:510— StatusItemController.scheduleManualRefreshViewportRestore 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.
UsageStore.presentationSnapshot (cyclomatic 18) Sources/CodexBar/UsageStore/UsageStore+Accessors.swift:42— UsageStore.presentationSnapshot has cyclomatic complexity 18 (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.
UsageStore.preservedClaudeWidgetUsage (cyclomatic 18) Sources/CodexBar/UsageStore/UsageStore+WidgetSnapshot.swift:376— UsageStore.preservedClaudeWidgetUsage 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.
UsageStore.resolvedCodexRefreshOutcome (cyclomatic 18) Sources/CodexBar/Providers/Codex/UsageStore+CodexPATRefresh.swift:46— UsageStore.resolvedCodexRefreshOutcome 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.
UsageStore.openAIDashboardFriendlyError (cyclomatic 18) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:1539— UsageStore.openAIDashboardFriendlyError has cyclomatic complexity 18 (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.
CodexConsumerProjection.make (cyclomatic 18) Sources/CodexBar/Providers/Codex/CodexConsumerProjection.swift:275— CodexConsumerProjection.make 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.
CodexBarCLI.runCacheClear (cyclomatic 18) Sources/CodexBarCLI/CLICacheCommand.swift:6— CodexBarCLI.runCacheClear 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.
CodexBarCLI.runCodexHostCosts (cyclomatic 18) Sources/CodexBarCLI/CLICodexHostCosts.swift:6— CodexBarCLI.runCodexHostCosts 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.
main.swift.top-level code (cyclomatic 18) Sources/CodexBarClaudeWatchdog/main.swift:9— main.swift.top-level code 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.
CostUsageFetcher.tokenSnapshot (cyclomatic 18) Sources/CodexBarCore/CostUsageFetcher.swift:1804— CostUsageFetcher.tokenSnapshot 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.
CostUsageTokenSnapshot.quotaWindowCoverage (cyclomatic 18) Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:523— CostUsageTokenSnapshot.quotaWindowCoverage has cyclomatic complexity 18 (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.
KeychainCacheStore.load (cyclomatic 18) Sources/CodexBarCore/KeychainCacheStore.swift:97— KeychainCacheStore.load 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.
PiFamilySessionScanner.scan (cyclomatic 18) Sources/CodexBarCore/PiFamilySessionScanner.swift:223— PiFamilySessionScanner.scan 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.
PiFamilySessionScanner.piSessionRootResolution (cyclomatic 18) Sources/CodexBarCore/PiFamilySessionScanner.swift:957— PiFamilySessionScanner.piSessionRootResolution 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.
Model.applyingUsageItemVisibility (cyclomatic 18) Sources/CodexBar/ProviderUsageItemVisibility.swift:188— Model.applyingUsageItemVisibility 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.
Model.monthlyTargetMetrics (cyclomatic 18) Sources/CodexBar/Menu/MenuCardView+MonthlyTarget.swift:5— Model.monthlyTargetMetrics has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Model.visibleProviderDetails (cyclomatic 18) Sources/CodexBar/Menu/MenuCardView+ProviderDetailVisibility.swift:5— Model.visibleProviderDetails 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.
SessionToolActivityParser.outcome (cyclomatic 18) Sources/CodexBarCore/SessionToolActivityParser.swift:74— SessionToolActivityParser.outcome has cyclomatic complexity 18 (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.
ProviderPluginSnapshotMapper.aggregateCostUsageEntries (cyclomatic 18) Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:493— ProviderPluginSnapshotMapper.aggregateCostUsageEntries 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.
QuickJSProviderPluginEngine.hostCookieHeader (cyclomatic 18) Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:704— QuickJSProviderPluginEngine.hostCookieHeader 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.
AntigravityLocalReader.readRows (cyclomatic 18) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSQLite.swift:535— AntigravityLocalReader.readRows 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.
AntigravityStatusSnapshot.normalizeModel (cyclomatic 18) Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:528— AntigravityStatusSnapshot.normalizeModel has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ClaudeProviderDescriptor.resolveStrategies (cyclomatic 18) Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:292— ClaudeProviderDescriptor.resolveStrategies has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ClaudeOAuthFetchStrategy.isPlausiblyAvailable (cyclomatic 18) Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:661— ClaudeOAuthFetchStrategy.isPlausiblyAvailable 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.
ClaudeCLIFetchStrategy.fetch (cyclomatic 18) Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:1129— ClaudeCLIFetchStrategy.fetch 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.
DeepSeekUsageCostParser.parseByAPIKey (cyclomatic 18) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:795— DeepSeekUsageCostParser.parseByAPIKey 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.
DoubaoUsageFetcher.apiErrorSummary (cyclomatic 18) Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:839— DoubaoUsageFetcher.apiErrorSummary 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.
KiroStatusProbe.runViaPipe (cyclomatic 18) Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:651— KiroStatusProbe.runViaPipe 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.
ClaudeOAuthPendingCacheClearUserDefaultsStore.withCacheTransaction (cyclomatic 18) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthPendingCacheClearStore.swift:151— ClaudeOAuthPendingCacheClearUserDefaultsStore.withCacheTransaction 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.
Usage.laneSegments (cyclomatic 18) Integrations/Linux/Shared/Usage.js:314— Usage.laneSegments has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 2 function literals inside it that branch. 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.
CLIArguments.parse (cyclomatic 17) Sources/AdaptiveReplayCLI/CLIArguments.swift:46— CLIArguments.parse 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.
HomebrewUpdateNotifier.postIfNeeded (cyclomatic 17) Sources/CodexBar/HomebrewUpdateNotifier.swift:48— HomebrewUpdateNotifier.postIfNeeded 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.
MenuDescriptor.hasAccount (cyclomatic 17) Sources/CodexBar/Menu/MenuDescriptor.swift:675— MenuDescriptor.hasAccount 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. This is NOT this file's highest cyclomatic complexity: MenuAction.systemImageName (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
SpendDashboardController.publishCurrentState (cyclomatic 17) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:1748— SpendDashboardController.publishCurrentState 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.
SpendTrendChartModel.emptyStateTitle (cyclomatic 17) Sources/CodexBar/SpendDashboard/SpendTrendChartModel.swift:118— SpendTrendChartModel.emptyStateTitle 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.
StatusItemController.kiroDisplayText (cyclomatic 17) Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:931— StatusItemController.kiroDisplayText 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.
StatusItemController.handleOverviewScrollWheel (cyclomatic 17) Sources/CodexBar/StatusItem/StatusItemController+OverviewScroll.swift:17— StatusItemController.handleOverviewScrollWheel 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.
UsageStore.postLimitResetCelebrationIfNeeded (cyclomatic 17) Sources/CodexBar/UsageStore/UsageStore+LimitResetCelebration.swift:181— UsageStore.postLimitResetCelebrationIfNeeded 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.
UsageStore.scheduleStorageFootprintRefresh (cyclomatic 17) Sources/CodexBar/UsageStore/UsageStore+ProviderStorage.swift:86— UsageStore.scheduleStorageFootprintRefresh 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.
UsageStore.widgetUsageRows (cyclomatic 17) Sources/CodexBar/UsageStore/UsageStore+WidgetSnapshot.swift:466— UsageStore.widgetUsageRows 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.
CLILocalHTTPServer.run (cyclomatic 17) Sources/CodexBarCLI/CLILocalHTTPServer.swift:328— CLILocalHTTPServer.run 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.
CLIServeResponseCache.mergeLastGoodUsageItems (cyclomatic 17) Sources/CodexBarCLI/CLIServeCommand.swift:398— CLIServeResponseCache.mergeLastGoodUsageItems 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.
CLIServeResponseCache.mergeLastGoodCostItems (cyclomatic 17) Sources/CodexBarCLI/CLIServeCommand.swift:491— CLIServeResponseCache.mergeLastGoodCostItems 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.
TokenAccountCLIContext.resolvedAccounts (cyclomatic 17) Sources/CodexBarCLI/TokenAccountCLI.swift:89— TokenAccountCLIContext.resolvedAccounts 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.
Entry.coverageCounts (cyclomatic 17) Sources/CodexBarCore/CostUsageModels.swift:594— Entry.coverageCounts 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.
LocalAgentSessionScanner.scanWithActivity (cyclomatic 17) Sources/CodexBarCore/LocalAgentSessionScanner.swift:202— LocalAgentSessionScanner.scanWithActivity 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.
PiFamilySessionScanner.profileSessionRoots (cyclomatic 17) Sources/CodexBarCore/PiFamilySessionScanner.swift:1084— PiFamilySessionScanner.profileSessionRoots has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ProviderEndpointOverrideValidator.isPrivateNetworkHost (cyclomatic 17) Sources/CodexBarCore/ProviderEndpointOverrideValidator.swift:150— ProviderEndpointOverrideValidator.isPrivateNetworkHost 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.
Model.usageItemDescriptors (cyclomatic 17) Sources/CodexBar/ProviderUsageItemVisibility.swift:103— Model.usageItemDescriptors 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.
SessionToolActivityStore.details (cyclomatic 17) Sources/CodexBarCore/SessionToolActivityStore.swift:36— SessionToolActivityStore.details 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.
SessionToolJSONProjection.punctuation (cyclomatic 17) Sources/CodexBarCore/SessionToolJSONProjection.swift:117— SessionToolJSONProjection.punctuation 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.
UsageSnapshot.backfillingResetTimes (cyclomatic 17) Sources/CodexBarCore/UsageFetcher.swift:563— UsageSnapshot.backfillingResetTimes has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (eligibleCachedReset). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ProviderPluginIconSVG.hasBoundedCanvas (cyclomatic 17) Sources/CodexBarCore/Plugins/ProviderPluginIconSVG.swift:43— ProviderPluginIconSVG.hasBoundedCanvas 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.
SpawnedProcessGroup.launchPTY (cyclomatic 17) Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:402— SpawnedProcessGroup.launchPTY 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.
SubprocessRunner.run (cyclomatic 17) Sources/CodexBarCore/Host/Process/SubprocessRunner.swift:133— SubprocessRunner.run has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
AlibabaTokenPlanUsageFetcher.throwIfErrorPayload (cyclomatic 17) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:728— AlibabaTokenPlanUsageFetcher.throwIfErrorPayload 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.
AntigravityLocalReader.readJSONLFile (cyclomatic 17) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalJSONL.swift:24— AntigravityLocalReader.readJSONLFile 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.
BedrockUsageFetcher.parseDailyResponse (cyclomatic 17) Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:364— BedrockUsageFetcher.parseDailyResponse 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.
ClaudeUsageFetcher.applyWebExtrasIfNeeded (cyclomatic 17) Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:1257— ClaudeUsageFetcher.applyWebExtrasIfNeeded 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.
DeepSeekUsageCostParser.decodeByAPIKeyPayloads (cyclomatic 17) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:923— DeepSeekUsageCostParser.decodeByAPIKeyPayloads 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.
FactoryStatusProbe.fetch (cyclomatic 17) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:635— FactoryStatusProbe.fetch 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.
OpenCodeGoLocalUsageReader.activeCredential (cyclomatic 17) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoLocalUsageReader.swift:682— OpenCodeGoLocalUsageReader.activeCredential 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.
OpenCodeGoUsageFetcher.parseWindow (cyclomatic 17) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:704— OpenCodeGoUsageFetcher.parseWindow 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.
ClaudeSubscriptionMetadata.parse (cyclomatic 17) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeSubscriptionMetadata.swift:24— ClaudeSubscriptionMetadata.parse has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to one function item inside it that branches. 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.
ShareStatsSanitizer.safeLabel (cyclomatic 16) Sources/CodexBar/ShareStatsPayload.swift:184— ShareStatsSanitizer.safeLabel has cyclomatic complexity 16 (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.
UsageMenuCardUsageContentView.body (cyclomatic 16) Sources/CodexBar/Menu/MenuCardView.swift:663— UsageMenuCardUsageContentView.body 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.
PlanUtilizationHistoryChartMenuView.seriesPoints (cyclomatic 16) Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:331— PlanUtilizationHistoryChartMenuView.seriesPoints 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.
SettingsStore.legacyCredentialSourceIsActive (cyclomatic 16) Sources/CodexBar/Settings/SettingsStore+Config.swift:89— SettingsStore.legacyCredentialSourceIsActive has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
StatusItemController.addMenuCards (cyclomatic 16) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:688— StatusItemController.addMenuCards 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.
UsageStore.loadTokenUsageSnapshot (cyclomatic 16) Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift:144— UsageStore.loadTokenUsageSnapshot has cyclomatic complexity 16 (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.
UsageStore.debugClaudeLog (cyclomatic 16) Sources/CodexBar/Providers/Claude/UsageStore+ClaudeDebug.swift:24— UsageStore.debugClaudeLog 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.
CursorLoginRunner.runUserInitiated (cyclomatic 16) Sources/CodexBar/Providers/Cursor/CursorLoginRunner.swift:210— CursorLoginRunner.runUserInitiated 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.
OpenAILiveUsageModel.refresh (cyclomatic 16) Sources/CodexBar/Providers/OpenAI/OpenAILiveUsageModel.swift:121— OpenAILiveUsageModel.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.
SpendDashboardProviderBreakdown.swift.spendDashboardProviderBreakdowns (cyclomatic 16) Sources/CodexBar/SpendDashboard/SpendDashboardProviderBreakdown.swift:33— SpendDashboardProviderBreakdown.swift.spendDashboardProviderBreakdowns has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
CodexBarCLI.dailyCostLines (cyclomatic 16) Sources/CodexBarCLI/CLICostCommand.swift:325— CodexBarCLI.dailyCostLines 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.
ToonSerializer.looksNumeric (cyclomatic 16) Sources/CodexBarCLI/ToonFormatter.swift:402— ToonSerializer.looksNumeric has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
AgentSessionNameFormatter.agentPath (cyclomatic 16) Sources/CodexBarCore/AgentSession.swift:690— AgentSessionNameFormatter.agentPath 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.
CodexThreadMetadataReader.projectMetadata (cyclomatic 16) Sources/CodexBarCore/CodexThreadMetadataReader+Projects.swift:12— CodexThreadMetadataReader.projectMetadata 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.
LocalAgentSessionScanner.sessions (cyclomatic 16) Sources/CodexBarCore/LocalAgentSessionScanner.swift:375— LocalAgentSessionScanner.sessions 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.
PiFamilySessionFileParser.parse (cyclomatic 16) Sources/CodexBarCore/PiFamilySessionScanner.swift:25— PiFamilySessionFileParser.parse has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
PiSessionCostScanner.extractUsage (cyclomatic 16) Sources/CodexBarCore/PiSessionCostScanner.swift:1151— PiSessionCostScanner.extractUsage has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
SessionToolActivityStore.scan (cyclomatic 16) Sources/CodexBarCore/SessionToolActivityStore.swift:130— SessionToolActivityStore.scan 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.
UsageLimitsAvailability.resolve (cyclomatic 16) Sources/CodexBarCore/UsageFetcher.swift:765— UsageLimitsAvailability.resolve 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.
OpenAIDashboardWebViewCache.acquire (cyclomatic 16) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardWebViewCache.swift:316— OpenAIDashboardWebViewCache.acquire 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.
ProviderPluginHTTPResponse.fetch (cyclomatic 16) Sources/CodexBarCore/Plugins/ProviderPluginHTTPResponse.swift:112— ProviderPluginHTTPResponse.fetch 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.
ProviderPluginSnapshotMapper.map (cyclomatic 16) Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:37— ProviderPluginSnapshotMapper.map has cyclomatic complexity 16 (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.
ProviderPluginSnapshotMapper.costUsage (cyclomatic 16) Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:372— ProviderPluginSnapshotMapper.costUsage 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.
AntigravityCLISession.finishProbe (cyclomatic 16) Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:306— AntigravityCLISession.finishProbe 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.
AntigravityLocalReader.inspectSQLiteTableSupport (cyclomatic 16) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSQLiteSchema.swift:21— AntigravityLocalReader.inspectSQLiteTableSupport 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.
AugmentSessionKeepalive.pingSessionEndpoint (cyclomatic 16) Sources/CodexBarCore/Providers/Augment/AugmentSessionKeepalive.swift:397— AugmentSessionKeepalive.pingSessionEndpoint 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.
ClaudeCLIScreen.write (cyclomatic 16) Sources/CodexBarCore/Providers/Claude/ClaudeCLIScreen.swift:59— ClaudeCLIScreen.write 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.
ClaudeCLISession.workspaceTrustKeys (cyclomatic 16) Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:265— ClaudeCLISession.workspaceTrustKeys 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.
ClaudeCLISession.ownsProcess (cyclomatic 16) Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:509— ClaudeCLISession.ownsProcess has cyclomatic complexity 16 (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.
ClaudeStatusProbe.extractUsageError (cyclomatic 16) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:650— ClaudeStatusProbe.extractUsageError 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.
CodexRequestLedger.pricingEvidence (cyclomatic 16) Sources/CodexBarCore/Providers/Codex/CodexRequestLedger.swift:299— CodexRequestLedger.pricingEvidence has cyclomatic complexity 16 (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.
CursorStatusProbe.fetchTeamSpend (cyclomatic 16) Sources/CodexBarCore/Providers/Cursor/CursorTeamSpend.swift:65— CursorStatusProbe.fetchTeamSpend 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.
DeepSeekUsageCostParser.parse (cyclomatic 16) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:296— DeepSeekUsageCostParser.parse 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.
DeepSeekUsageCostParser.aggregateMonth (cyclomatic 16) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:582— DeepSeekUsageCostParser.aggregateMonth 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. This shape REPEATS in the file: one other method here (DeepSeekUsageCostParser.buildDailyUsages) 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.
DeepSeekUsageCostParser.buildDailyUsages (cyclomatic 16) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:713— DeepSeekUsageCostParser.buildDailyUsages 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. This shape REPEATS in the file: one other method here (DeepSeekUsageCostParser.aggregateMonth) 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.
DevinUsageParser.percent (cyclomatic 16) Sources/CodexBarCore/Providers/Devin/DevinUsageSnapshot.swift:204— DevinUsageParser.percent 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.
KiroUsageLimitsAPI.parse (cyclomatic 16) Sources/CodexBarCore/Providers/Kiro/KiroUsageLimitsAPI.swift:210— KiroUsageLimitsAPI.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.
OpenAILiveUsageBuilder.build (cyclomatic 16) Sources/CodexBarCore/Providers/OpenAI/OpenAILiveUsageBuilder.swift:5— OpenAILiveUsageBuilder.build 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.
OpenAIOrgRateLimitsFetcher.pages (cyclomatic 16) Sources/CodexBarCore/Providers/OpenAI/OpenAIOrgRateLimitsFetcher.swift:64— OpenAIOrgRateLimitsFetcher.pages 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.
CacheBox.read (cyclomatic 16) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoLocalUsageReader.swift:268— CacheBox.read 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.
Aggregate.init (cyclomatic 16) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoLocalUsageReader.swift:334— Aggregate.init 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.
OpenCodeGoZenBalanceParser.parseConsoleBillingStatus (cyclomatic 16) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoZenBalanceParser.swift:6— OpenCodeGoZenBalanceParser.parseConsoleBillingStatus has cyclomatic complexity 16 (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.
ClaudeOAuthCredentialsStore.claudeKeychainCandidatesProbeWithoutPrompt (cyclomatic 16) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:2309— ClaudeOAuthCredentialsStore.claudeKeychainCandidatesProbeWithoutPrompt 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.
ClaudeOAuthCredentialsStore.readRawClaudeKeychainPayloadViaSecurityCLIIfEnabled (cyclomatic 16) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials+SecurityCLIReader.swift:88— ClaudeOAuthCredentialsStore.readRawClaudeKeychainPayloadViaSecurityCLIIfEnabled 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.
WidgetUsageRow.rows (cyclomatic 16) Sources/CodexBarWidget/CodexBarWidgetViews.swift:364— WidgetUsageRow.rows 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.
Notifications.transition (cyclomatic 16) Integrations/Linux/Shared/Notifications.js:2— Notifications.transition has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 10, 8, 5). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
TodoComment Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:567— // TODO: Confirm usedRatio contract (0.0-1.0 vs 0.0-100.0) and tighten this fallback. — 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.
fetchUsage (cognitive 222) Sources/CodexBarCore/Resources/Plugins/openrouter.js:24— fetchUsage has cognitive complexity 222 (threshold 15). Drivers by points: if/else 59 (124 pts), boolean chains 41, ternaries 14 (30 pts), loops 4 (12 pts), error handling 6 (10 pts), other 5 (nesting depth added 93). Of this number, 202 points are the body's own statements and 20 belong to 9 function items inside it that branch. 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.
TTYCommandRunner.run (cognitive 141) Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:459— TTYCommandRunner.run has cognitive complexity 141 (threshold 15). Drivers by points: if/else 81 (155 pts), boolean chains 38, loops 8 (15 pts), ternaries 4 (7 pts), match/switch 1 (3 pts), error handling 2 (nesting depth added 86). To reduce it, split the body into named stages: move each independent 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 (TTYCommandRunner.run::processNonCodexChunk) 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.
ProviderPluginManifest.init (cognitive 125) Sources/CodexBarCore/Plugins/ProviderPluginManifest.swift:133— ProviderPluginManifest.init has cognitive complexity 125 (threshold 15). Drivers by points: if/else 51 (83 pts), boolean chains 33, loops 5 (7 pts), match/switch 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AntigravityOAuthConfig.binaryClient (cognitive 108) Sources/CodexBarCore/Providers/Antigravity/AntigravityOAuthCredentialsStore.swift:322— AntigravityOAuthConfig.binaryClient has cognitive complexity 108 (threshold 15). Drivers by points: if/else 18 (59 pts), boolean chains 32, ternaries 3 (11 pts), loops 3 (6 pts) (nesting depth added 52). Of this number, 92 points are the body's own statements and 16 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage (cognitive 96) Sources/CodexBarCore/Resources/Plugins/zai.js:24— fetchUsage has cognitive complexity 96 (threshold 15). Drivers by points: if/else 55 (78 pts), boolean chains 60, ternaries 34 (49 pts), loops 3 (5 pts), error handling 2 (4 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.
fetchUsage (cognitive 95) Sources/CodexBarCore/Resources/Plugins/poe.js:15— fetchUsage has cognitive complexity 95 (threshold 15). Drivers by points: ternaries 18 (31 pts), if/else 20 (30 pts), boolean chains 24, other 5, loops 3 (4 pts), error handling 1 (nesting depth added 24). Of this number, 74 points are the body's own statements and 21 belong to 17 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeCLISession.captureExclusive (cognitive 87) Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:145— ClaudeCLISession.captureExclusive has cognitive complexity 87 (threshold 15). Drivers by points: if/else 19 (49 pts), boolean chains 23, ternaries 2 (8 pts), loops 3 (7 pts) (nesting depth added 40). Of this number, 86 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
fetchUsage (cognitive 87) Sources/CodexBarCore/Resources/Plugins/openai.js:14— fetchUsage has cognitive complexity 87 (threshold 15). Drivers by points: if/else 42 (80 pts), boolean chains 61, ternaries 25 (41 pts), loops 10 (16 pts), error handling 4 (5 pts) (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage (cognitive 82) Sources/CodexBarCore/Resources/Plugins/sub2api.js:10— fetchUsage has cognitive complexity 82 (threshold 15). Drivers by points: boolean chains 41, if/else 30 (34 pts), error handling 3, ternaries 3, loops 1 (nesting depth added 4). Of this number, 55 points are the body's own statements and 27 belong to 9 function items inside it that branch. 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.
CostUsageFetcher.loadTokenResult (cognitive 81) Sources/CodexBarCore/CostUsageFetcher.swift:493— CostUsageFetcher.loadTokenResult has cognitive complexity 81 (threshold 15). Drivers by points: if/else 33 (52 pts), boolean chains 21, error handling 2 (3 pts), loops 1 (3 pts), ternaries 1 (2 pts) (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.
UsageStore.limitResetDetectorTransition (cognitive 78) Sources/CodexBar/UsageStore/UsageStore+LimitResetCelebration.swift:301— UsageStore.limitResetDetectorTransition has cognitive complexity 78 (threshold 15). Drivers by points: boolean chains 44, if/else 25 (26 pts), ternaries 6 (8 pts) (nesting depth added 3). 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.
MenuBarLayoutRenderer.renderUncached (cognitive 72) Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:431— MenuBarLayoutRenderer.renderUncached has cognitive complexity 72 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 23, ternaries 9 (17 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
applyProviderPluginPrelude (cognitive 72) REDACTED:2— applyProviderPluginPrelude has cognitive complexity 72 (threshold 15). Drivers by points: if/else 24 (36 pts), boolean chains 17, ternaries 11, loops 6, error handling 2 (nesting depth added 12). None of this is in the body itself: all 72 points belong to 52 function items inside it that branch (postOptions, a function literal at line 105, formatNumber, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
UsageStore.runCodexCostCatchUp (cognitive 71) Sources/CodexBar/Providers/Codex/UsageStore+CodexCostCatchUp.swift:107— UsageStore.runCodexCostCatchUp has cognitive complexity 71 (threshold 15). Drivers by points: if/else 11 (41 pts), error handling 4 (10 pts), boolean chains 7, ternaries 2 (6 pts), match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderPluginCookiePolicy.init (cognitive 71) Sources/CodexBarCore/Plugins/ProviderPluginCookiePolicy.swift:42— ProviderPluginCookiePolicy.init has cognitive complexity 71 (threshold 15). Drivers by points: boolean chains 45, if/else 19 (25 pts), ternaries 1 (nesting depth added 6). 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.
SpendDashboardSource.load (cognitive 67) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:488— SpendDashboardSource.load has cognitive complexity 67 (threshold 15). Drivers by points: if/else 10 (36 pts), error handling 4 (16 pts), loops 4 (14 pts), ternaries 1 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
StatusItemController.applyIcon (cognitive 66) Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:361— StatusItemController.applyIcon has cognitive complexity 66 (threshold 15). Drivers by points: ternaries 23 (35 pts), if/else 14 (19 pts), boolean chains 12 (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.
fetchUsage (cognitive 65) Sources/CodexBarCore/Resources/Plugins/deepgram.js:11— fetchUsage has cognitive complexity 65 (threshold 15). Drivers by points: if/else 25 (31 pts), boolean chains 26, loops 3 (4 pts), error handling 2, ternaries 2 (nesting depth added 7). Of this number, 29 points are the body's own statements and 36 belong to 8 function items inside it that branch. 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.
CodexCLISession.captureStatus (cognitive 64) Sources/CodexBarCore/Providers/Codex/CodexCLISession.swift:52— CodexCLISession.captureStatus has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (45 pts), boolean chains 16, loops 2 (3 pts) (nesting depth added 25). Of this number, 63 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CostHistoryChartMenuView.body (cognitive 62) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:119— CostHistoryChartMenuView.body has cognitive complexity 62 (threshold 15). Drivers by points: if/else 21 (43 pts), ternaries 9 (17 pts), boolean chains 2 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexBarCLI.topCostModelLines (cognitive 62) Sources/CodexBarCLI/CLICostCommand.swift:363— CodexBarCLI.topCostModelLines has cognitive complexity 62 (threshold 15). Drivers by points: if/else 14 (30 pts), ternaries 11 (19 pts), boolean chains 9, loops 3 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatusItemController.addActionableSections (cognitive 60) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:852— StatusItemController.addActionableSections has cognitive complexity 60 (threshold 15). Drivers by points: if/else 12 (41 pts), loops 3 (7 pts), ternaries 1 (5 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PiSessionCostScanner.loadDailyReportResultCancellable (cognitive 59) Sources/CodexBarCore/PiSessionCostScanner.swift:155— PiSessionCostScanner.loadDailyReportResultCancellable has cognitive complexity 59 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 18, loops 4 (10 pts), ternaries 3 (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.
GrokLocalSessionScanner.summarize (cognitive 58) Sources/CodexBarCore/Providers/Grok/GrokLocalSessionScanner.swift:81— GrokLocalSessionScanner.summarize has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 7 (21 pts), boolean chains 6 (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.
CodexRequestLedger.load (cognitive 57) Sources/CodexBarCore/Providers/Codex/CodexRequestLedger.swift:111— CodexRequestLedger.load has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (34 pts), boolean chains 19, loops 3 (4 pts) (nesting depth added 16). Of this number, 54 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage (cognitive 57) REDACTED:11— fetchUsage has cognitive complexity 57 (threshold 15). Drivers by points: if/else 23 (34 pts), boolean chains 10, ternaries 6 (8 pts), loops 2 (3 pts), error handling 1, other 1 (nesting depth added 14). Of this number, 47 points are the body's own statements and 10 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderSettingsTokenAccountsRowView.body (cognitive 55) Sources/CodexBar/Settings/PreferencesProviderSettingsRows.swift:248— ProviderSettingsTokenAccountsRowView.body has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (29 pts), ternaries 10 (22 pts), boolean chains 4 (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.
SpendDashboardModel.modelSummary (cognitive 55) Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:42— SpendDashboardModel.modelSummary has cognitive complexity 55 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 18, loops 3 (6 pts), ternaries 2, 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.
OpenAIDashboardFetcher.collectPageSnapshot (cognitive 55) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher+PageScrape.swift:34— OpenAIDashboardFetcher.collectPageSnapshot has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (40 pts), boolean chains 14, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CostUsageFetcher.loadCachedCodexTokenSnapshotResult (cognitive 54) Sources/CodexBarCore/CostUsageFetcher.swift:1418— CostUsageFetcher.loadCachedCodexTokenSnapshotResult has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 21, ternaries 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.
install.main (cognitive 53) Integrations/Linux/install.py:61— install.main has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 6 (14 pts), boolean chains 9, ternaries 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.
fetchUsage (cognitive 53) Sources/CodexBarCore/Resources/Plugins/opendesign.js:14— fetchUsage has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 11, ternaries 5 (7 pts), error handling 2 (4 pts), loops 1, other 1 (nesting depth added 18). Of this number, 22 points are the body's own statements and 31 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.menuCardInput (cognitive 52) Sources/CodexBar/UsageStore/UsageStore+MenuCardModel.swift:55— UsageStore.menuCardInput has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 23 (26 pts), boolean chains 23, if/else 3 (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.
UsageStore.handleProviderFetchFailure (cognitive 52) Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:1305— UsageStore.handleProviderFetchFailure has cognitive complexity 52 (threshold 15). Drivers by points: boolean chains 26, if/else 21 (26 pts) (nesting depth added 5). 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.
DeepSeekUsageCostParser.aggregateMonth (cognitive 51) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:582— DeepSeekUsageCostParser.aggregateMonth has cognitive complexity 51 (threshold 15). Drivers by points: if/else 10 (34 pts), loops 5 (15 pts), boolean chains 2 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (DeepSeekUsageCostParser.buildDailyUsages) 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.
DeepSeekUsageCostParser.buildDailyUsages (cognitive 51) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:713— DeepSeekUsageCostParser.buildDailyUsages has cognitive complexity 51 (threshold 15). Drivers by points: if/else 10 (34 pts), loops 5 (15 pts), boolean chains 2 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (DeepSeekUsageCostParser.aggregateMonth) 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.
QoderCookieRouting.preprocessedCurlShellText (cognitive 51) Sources/CodexBarCore/Providers/Qoder/QoderCookieRouting.swift:399— QoderCookieRouting.preprocessedCurlShellText has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (39 pts), boolean chains 8, match/switch 1 (2 pts), loops 1, ternaries 1 (nesting depth added 25). 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.
fetchUsage (cognitive 51) REDACTED:10— fetchUsage has cognitive complexity 51 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 14, ternaries 5 (8 pts), loops 2 (5 pts), error handling 2 (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.
BurnTheme.init (cognitive 50) Sources/CodexBarWidget/BurnDownWidgetViews.swift:550— BurnTheme.init has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 24 (48 pts), if/else 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.
MenuDescriptor.usageSection (cognitive 49) Sources/CodexBar/Menu/MenuDescriptor.swift:253— MenuDescriptor.usageSection has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 11, ternaries 2 (7 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PiSessionCostScanner.parsePiSessionFile (cognitive 49) Sources/CodexBarCore/PiSessionCostScanner.swift:832— PiSessionCostScanner.parsePiSessionFile has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (44 pts), boolean chains 3, error handling 2 (nesting depth added 20). Of this number, 43 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderPluginCookieBroker.advance (cognitive 49) Sources/CodexBarCore/Plugins/ProviderPluginCookieBroker.swift:301— ProviderPluginCookieBroker.advance has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 7, ternaries 2 (6 pts), loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.importOpenAIDashboardCookiesIfNeeded (cognitive 48) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:1182— UsageStore.importOpenAIDashboardCookiesIfNeeded has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (28 pts), ternaries 4 (10 pts), boolean chains 4, match/switch 2 (4 pts), error handling 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.
Usage.rows (cognitive 47) Integrations/Linux/Shared/Usage.js:39— Usage.rows has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 27, ternaries 16 (17 pts), if/else 3 (nesting depth added 1). Most of this is not in the body itself: 4 of the 47 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 44, 57, 65, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UsageStore.resolvePlanUtilizationAccountKey (cognitive 45) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:1077— UsageStore.resolvePlanUtilizationAccountKey has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 10 (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.
DeepSeekUsageCostParser.parseByAPIKey (cognitive 45) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:795— DeepSeekUsageCostParser.parseByAPIKey has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 8 (17 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.
MiniMaxLocalStorageImporter.importAccessTokens (cognitive 45) Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:14— MiniMaxLocalStorageImporter.importAccessTokens has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 6 (14 pts), ternaries 3 (12 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage (cognitive 45) Sources/CodexBarCore/Resources/Plugins/perplexity.js:8— fetchUsage has cognitive complexity 45 (threshold 15). Drivers by points: if/else 23 (40 pts), boolean chains 18, other 14, ternaries 10 (11 pts), loops 6 (7 pts), error handling 1 (2 pts) (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.
SpendDashboardModel.projectRows (cognitive 43) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:832— SpendDashboardModel.projectRows has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 9, loops 3 (6 pts), ternaries 2, match/switch 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.
UsageStore.runSpendDashboardCodexCostCatchUp (cognitive 43) Sources/CodexBar/Providers/Codex/UsageStore+SpendDashboardCodexCostCatchUp.swift:143— UsageStore.runSpendDashboardCodexCostCatchUp has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 6, error handling 2 (4 pts), ternaries 2 (4 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 20). Of this number, 41 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PiFamilySessionScanner.costSessionRoots (cognitive 43) Sources/CodexBarCore/PiFamilySessionScanner.swift:391— PiFamilySessionScanner.costSessionRoots has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 9, loops 4 (7 pts), match/switch 2 (6 pts), ternaries 1 (nesting depth added 17). Of this number, 39 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage (cognitive 43) Sources/CodexBarCore/Resources/Plugins/clawrouter.js:16— fetchUsage has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 12, ternaries 2 (3 pts), error handling 1 (nesting depth added 7). Of this number, 32 points are the body's own statements and 11 belong to 8 function items inside it that branch. 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.
StatusItemController.populateMenu (cognitive 42) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:222— StatusItemController.populateMenu has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 32, if/else 6, ternaries 3, match/switch 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
UsageStore.performOpenAIDashboardRefreshIfNeeded (cognitive 42) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:539— UsageStore.performOpenAIDashboardRefreshIfNeeded has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (37 pts), error handling 3, boolean chains 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MenuDescriptor.accountEntries (cognitive 41) Sources/CodexBar/Menu/MenuDescriptor.swift:437— MenuDescriptor.accountEntries has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 13, ternaries 1 (3 pts), loops 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.
UsageStore.refreshCodexVisibleAccountsForMenu (cognitive 41) Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:150— UsageStore.refreshCodexVisibleAccountsForMenu has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 7, ternaries 3 (6 pts), loops 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.
OpenCodeGoLocalUsageFetchStrategy.snapshotWithoutCLILogin (cognitive 41) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift:256— OpenCodeGoLocalUsageFetchStrategy.snapshotWithoutCLILogin has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 9 (14 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MenuBarLayoutPersistence.preferredLibrary (cognitive 40) Sources/CodexBar/Menu/MenuBarLayout.swift:1414— MenuBarLayoutPersistence.preferredLibrary has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 10 (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.
UsageMenuCardView.body (cognitive 40) Sources/CodexBar/Menu/MenuCardView.swift:225— UsageMenuCardView.body has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 10, ternaries 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.
QuotaSnapshots.init (cognitive 40) Sources/CodexBarCore/CopilotUsageModels.swift:233— QuotaSnapshots.init has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 9, error handling 1 (3 pts), loops 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.
AlibabaCodingPlanUsageFetcher.parseUsageSnapshot (cognitive 40) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:443— AlibabaCodingPlanUsageFetcher.parseUsageSnapshot has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 13 (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.
AlibabaTokenPlanCLIUsageParser.teamUsage (cognitive 40) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCLIUsageFetcher.swift:81— AlibabaTokenPlanCLIUsageParser.teamUsage has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 26, if/else 7 (12 pts), loops 1, ternaries 1 (nesting depth added 5). 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.
AntigravityLocalReader.aggregate (cognitive 40) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalReader.swift:187— AntigravityLocalReader.aggregate has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 7, ternaries 3, loops 2 (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.
KiroStatusProbe.runCommand (cognitive 40) Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:1176— KiroStatusProbe.runCommand has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (36 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage (cognitive 40) REDACTED:15— fetchUsage has cognitive complexity 40 (threshold 15). Drivers by points: if/else 50 (66 pts), boolean chains 36, ternaries 20 (28 pts), loops 5 (6 pts), error handling 1 (2 pts), other 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionEquivalentBurnEstimator.estimate (cognitive 39) Sources/CodexBar/SessionEquivalentForecast.swift:172— SessionEquivalentBurnEstimator.estimate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 17, loops 2, ternaries 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.
MenuBarLayoutRenderer.removeDuplicateBalanceResets (cognitive 39) Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:592— MenuBarLayoutRenderer.removeDuplicateBalanceResets has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 13, loops 5 (13 pts), if/else 6 (9 pts), ternaries 1 (4 pts) (nesting depth added 14). Of this number, 38 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpendDashboardSource.makeRequest (cognitive 39) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:223— SpendDashboardSource.makeRequest has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 9, loops 2 (3 pts), ternaries 2 (3 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.
UsageStore.refreshCreditsIfNeeded (cognitive 39) Sources/CodexBar/Providers/Codex/UsageStore+CodexRefresh.swift:124— UsageStore.refreshCreditsIfNeeded has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 9, ternaries 1 (2 pts), error handling 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.
AntigravityCLISession.ensureStartedLocked (cognitive 39) Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:498— AntigravityCLISession.ensureStartedLocked has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 6, error handling 2 (4 pts), ternaries 1 (3 pts), 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.
AuggieCLIProbe.parse (cognitive 39) Sources/CodexBarCore/Providers/Augment/AuggieCLIProbe.swift:55— AuggieCLIProbe.parse has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 5, 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.
KiloUsageFetcher.creditFields (cognitive 39) Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:579— KiloUsageFetcher.creditFields has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 11, ternaries 2 (6 pts), loops 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.
IconRenderer.makeIcon (cognitive 38) Sources/CodexBar/IconRenderer.swift:142— IconRenderer.makeIcon has cognitive complexity 38 (threshold 15). Drivers by points: if/else 40 (63 pts), ternaries 11 (22 pts), boolean chains 13, loops 5 (12 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent 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 (IconRenderer.makeIcon::drawBar) 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.
OpenAIDashboardBrowserCookieImporter.importBestCookies (cognitive 38) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:119— OpenAIDashboardBrowserCookieImporter.importBestCookies has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (18 pts), error handling 3 (11 pts), match/switch 1 (4 pts), boolean chains 2, loops 2, 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.
AmpUsageParser.parse (cognitive 38) Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift:20— AmpUsageParser.parse has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 19, if/else 10 (12 pts), ternaries 5 (7 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Lexer.number (cognitive 38) Sources/CodexBarCore/Providers/Antigravity/AntigravityJSONLObject.swift:116— Lexer.number has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (22 pts), loops 4 (7 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 10). Of this number, 34 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MiniMaxLocalStorageImporter.readLocalStorage (cognitive 38) Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:142— MiniMaxLocalStorageImporter.readLocalStorage has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 6 (11 pts), boolean chains 9 (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.
UsageStore.handleSessionQuotaTransition (cognitive 37) Sources/CodexBar/UsageStore/UsageStore+SessionQuotaTransition.swift:7— UsageStore.handleSessionQuotaTransition has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 9, ternaries 1 (3 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.
Model.extraRateWindowMetrics (cognitive 37) Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:948— Model.extraRateWindowMetrics has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18, boolean chains 12, ternaries 7. 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.
ProviderPluginHTTPResponse.request (cognitive 37) Sources/CodexBarCore/Plugins/ProviderPluginHTTPResponse.swift:227— ProviderPluginHTTPResponse.request has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 7, ternaries 2 (4 pts), loops 1 (2 pts), match/switch 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.
Lexer.object (cognitive 37) Sources/CodexBarCore/Providers/Antigravity/AntigravityJSONLObject.swift:34— Lexer.object has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 3 (5 pts), boolean chains 3, match/switch 1 (2 pts) (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.
StatusItemController.menuIdentitySignature (cognitive 36) Sources/CodexBar/StatusItem/StatusItemController+MenuTracking.swift:392— StatusItemController.menuIdentitySignature has cognitive complexity 36 (threshold 15). Drivers by points: loops 6 (15 pts), ternaries 3 (12 pts), if/else 4 (8 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.applyProviderRefreshSuccess (cognitive 36) Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:631— UsageStore.applyProviderRefreshSuccess has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20, boolean chains 13, ternaries 2 (3 pts) (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.
SessionToolActivityStore.scan (cognitive 36) Sources/CodexBarCore/SessionToolActivityStore.swift:130— SessionToolActivityStore.scan has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
FactoryStatusProbe.fetchWithCookies (cognitive 36) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:930— FactoryStatusProbe.fetchWithCookies has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 5 (11 pts), boolean chains 5, match/switch 1 (4 pts), loops 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.
SessionUsagePresentation.sessions (cognitive 35) Sources/CodexBar/SessionUsagePresentation.swift:17— SessionUsagePresentation.sessions has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 5 (13 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.
MenuBarLayoutRenderer.renderItem (cognitive 35) Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:754— MenuBarLayoutRenderer.renderItem has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 9 (20 pts), if/else 5 (8 pts), boolean chains 6, 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.
SpendDashboardController.handleBuiltRequest (cognitive 35) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:1440— SpendDashboardController.handleBuiltRequest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 9, ternaries 1 (3 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatusItemController.addOverviewRows (cognitive 35) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:547— StatusItemController.addOverviewRows has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (23 pts), ternaries 3 (8 pts), boolean chains 3, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.reconcileClaudeRefreshAfterFetch (cognitive 35) Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:493— UsageStore.reconcileClaudeRefreshAfterFetch has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 19, if/else 13 (15 pts), ternaries 1 (nesting depth added 2). 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.
UsageStore.refreshTokenUsage (cognitive 35) Sources/CodexBar/UsageStore/UsageStore.swift:1428— UsageStore.refreshTokenUsage has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 8, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SignatureReader.validate (cognitive 35) Sources/CodexBarCore/CodexLaunchPreflight+SignatureIdentity.swift:131— SignatureReader.validate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 13, 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.
PiFamilySessionScanner.scan (cognitive 35) Sources/CodexBarCore/PiFamilySessionScanner.swift:223— PiFamilySessionScanner.scan has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 5, loops 2 (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.
AntigravityLocalReader.discover (cognitive 35) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalScan.swift:132— AntigravityLocalReader.discover has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (26 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeepSeekUsageCostParser.aggregateDay (cognitive 35) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:540— DeepSeekUsageCostParser.aggregateDay has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 4 (10 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeOAuthPendingCacheClearUserDefaultsStore.withCacheTransaction (cognitive 35) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthPendingCacheClearStore.swift:151— ClaudeOAuthPendingCacheClearUserDefaultsStore.withCacheTransaction has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 5, ternaries 1 (3 pts), match/switch 1 (2 pts), error handling 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.
fetchUsage (cognitive 35) Sources/CodexBarCore/Resources/Plugins/venice.js:15— fetchUsage has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 15, if/else 13, ternaries 5 (7 pts) (nesting depth added 2). Of this number, 30 points are the body's own statements and 5 belong to one function item inside it that branches. 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.
HistoricalUsageHistoryStore.backfillCodexWeeklyFromUsageBreakdown (cognitive 34) Sources/CodexBar/HistoricalUsagePace.swift:154— HistoricalUsageHistoryStore.backfillCodexWeeklyFromUsageBreakdown has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 8, loops 2 (3 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.
UsageStore.resolvedClaudeOAuthHistoryOwner (cognitive 34) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:998— UsageStore.resolvedClaudeOAuthHistoryOwner has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 7, ternaries 3 (6 pts), loops 1 (3 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.
CodexBarCLI.runStandardCost (cognitive 34) Sources/CodexBarCLI/CLICostCommand.swift:18— CodexBarCLI.runStandardCost has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, match/switch 2 (4 pts), error handling 2 (3 pts), loops 1, ternaries 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.
SignatureReader.slice (cognitive 34) Sources/CodexBarCore/CodexLaunchPreflight+SignatureIdentity.swift:89— SignatureReader.slice has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 16, if/else 8 (14 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CostUsageFetcher.codexBreakdownsWithMetadata (cognitive 34) Sources/CodexBarCore/CostUsageFetcher.swift:1058— CostUsageFetcher.codexBreakdownsWithMetadata has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 5 (7 pts), boolean chains 6 (nesting depth added 14). Of this number, 33 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MuseLocalUsageReader.parseLine (cognitive 34) Sources/CodexBarCore/Providers/Muse/MuseLocalUsageReader.swift:496— MuseLocalUsageReader.parseLine has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 21, if/else 11, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
fetchUsage (cognitive 34) Sources/CodexBarCore/Resources/Plugins/manus.js:8— fetchUsage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 10 (11 pts), boolean chains 9, error handling 1, loops 1, other 1 (nesting depth added 3). Of this number, 22 points are the body's own statements and 12 belong to 5 function items inside it that branch. 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.
CodexHistoricalPaceEvaluator.evaluate (cognitive 33) Sources/CodexBar/HistoricalUsagePace.swift:758— CodexHistoricalPaceEvaluator.evaluate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (20 pts), loops 4 (6 pts), boolean chains 5, ternaries 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SpendDashboardModel.buildCurrencyGroup (cognitive 33) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:583— SpendDashboardModel.buildCurrencyGroup has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (11 pts), loops 3 (4 pts), match/switch 2 (4 pts), ternaries 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.
UsageStore.shouldExcludeFromHighestUsage (cognitive 33) Sources/CodexBar/UsageStore/UsageStore+HighestUsage.swift:92— UsageStore.shouldExcludeFromHighestUsage has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 11, 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.
UsageStore.handleQuotaWarningTransitions (cognitive 33) Sources/CodexBar/UsageStore/UsageStore+QuotaWarnings.swift:36— UsageStore.handleQuotaWarningTransitions has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 6 (9 pts), boolean chains 8, loops 2 (4 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, 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.
CodexBarCLI.collectCodexIdentifiedUsage (cognitive 33) Sources/CodexBarCLI/CLICodexIdentifiedUsage.swift:96— CodexBarCLI.collectCodexIdentifiedUsage has cognitive complexity 33 (threshold 15). Drivers by points: if/else 4 (14 pts), ternaries 5 (13 pts), error handling 2 (4 pts), boolean chains 1, loops 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.
PiSessionCostScanner.buildReport (cognitive 33) Sources/CodexBarCore/PiSessionCostScanner+Aggregation.swift:17— PiSessionCostScanner.buildReport has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 11 (18 pts), if/else 5 (11 pts), loops 2 (3 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.
AntigravityLocalReader.readDatabase (cognitive 33) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSQLite.swift:133— AntigravityLocalReader.readDatabase has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 4, loops 1 (3 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AugmentSessionKeepalive.pingSessionEndpoint (cognitive 33) Sources/CodexBarCore/Providers/Augment/AugmentSessionKeepalive.swift:397— AugmentSessionKeepalive.pingSessionEndpoint has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SessionQuotaTransitionReducer.evaluate (cognitive 32) Sources/CodexBar/SessionQuotaNotifications.swift:155— SessionQuotaTransitionReducer.evaluate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 13, match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.makeWidgetEntry (cognitive 32) Sources/CodexBar/UsageStore/UsageStore+WidgetSnapshot.swift:256— UsageStore.makeWidgetEntry has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12, boolean chains 10, ternaries 7 (9 pts), match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CodexWeeklyResetConfirmation.confirmationDecision (cognitive 32) Sources/CodexBar/Providers/Codex/CodexWeeklyResetConfirmation.swift:155— CodexWeeklyResetConfirmation.confirmationDecision has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 18, if/else 9 (11 pts), ternaries 1 (3 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CopilotLoginFlow.run (cognitive 32) Sources/CodexBar/Providers/Copilot/CopilotLoginFlow.swift:7— CopilotLoginFlow.run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (18 pts), ternaries 2 (7 pts), error handling 2 (4 pts), match/switch 1 (2 pts), boolean chains 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.
AmpUsageSnapshot.toUsageSnapshot (cognitive 32) Sources/CodexBarCore/Providers/Amp/AmpUsageSnapshot.swift:91— AmpUsageSnapshot.toUsageSnapshot has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 6, ternaries 4 (6 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, 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.
CursorStatusProbe.resolveSession (cognitive 32) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe+SessionResolution.swift:37— CursorStatusProbe.resolveSession has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 5 (9 pts), boolean chains 6, ternaries 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UsageStore.planUtilizationSeriesSamples (cognitive 31) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:561— UsageStore.planUtilizationSeriesSamples has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 7, loops 1 (2 pts), match/switch 2 (nesting depth added 9). Of this number, 24 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.refreshSpendDashboardTokenUsageNow (cognitive 31) Sources/CodexBar/UsageStore/UsageStore+SpendDashboardTokenCost.swift:70— UsageStore.refreshSpendDashboardTokenUsageNow has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 6, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexWeeklyResetConfirmation.evaluateDelayedCandidateCreation (cognitive 31) Sources/CodexBar/Providers/Codex/CodexWeeklyResetConfirmation.swift:234— CodexWeeklyResetConfirmation.evaluateDelayedCandidateCreation has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18, boolean chains 13. 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.
CodexWeeklyResetConfirmation.evaluateDelayedCandidate (cognitive 31) Sources/CodexBar/Providers/Codex/CodexWeeklyResetConfirmation.swift:295— CodexWeeklyResetConfirmation.evaluateDelayedCandidate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19, boolean chains 11, ternaries 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.
CodexBarCLI.fetchUsageOutput (cognitive 31) Sources/CodexBarCLI/CLIUsageCommand.swift:423— CodexBarCLI.fetchUsageOutput has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 7, ternaries 2 (3 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PiFamilySessionScanner.retainedSettingsRootResolution (cognitive 31) Sources/CodexBarCore/PiFamilySessionScanner.swift:756— PiFamilySessionScanner.retainedSettingsRootResolution has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6, ternaries 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Model.metrics (cognitive 31) Sources/CodexBar/Menu/MenuCardView.swift:1220— Model.metrics has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 13, if/else 10 (11 pts), ternaries 4 (7 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Model.secondaryMetric (cognitive 31) Sources/CodexBar/Menu/MenuCardView.swift:1397— Model.secondaryMetric has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 15, if/else 13 (14 pts), ternaries 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.
CodexBarConfigValidator.validateProvider (cognitive 31) Sources/CodexBarCore/Config/CodexBarConfigValidation.swift:112— CodexBarConfigValidator.validateProvider has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 20, if/else 11. 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.
JavaScriptCoreProviderPluginEngine.makeContext (cognitive 31) Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:639— JavaScriptCoreProviderPluginEngine.makeContext has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 8, error handling 6, ternaries 3 (4 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.
AntigravityLocalReader.readStepTimestamps (cognitive 31) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSQLite.swift:322— AntigravityLocalReader.readStepTimestamps has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 7, 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.
AntigravityLocalReader.appendRecoveredEvents (cognitive 31) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSQLite.swift:619— AntigravityLocalReader.appendRecoveredEvents has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 2, loops 2 (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.
Repository.loadRecord (cognitive 31) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:336— Repository.loadRecord has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 5, error handling 3 (4 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeSubscriptionMetadataFetcher.fetchVerified (cognitive 31) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeSubscriptionMetadata.swift:113— ClaudeSubscriptionMetadataFetcher.fetchVerified has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 8, ternaries 1 (2 pts), error handling 1 (nesting depth added 11). Of this number, 18 points are the body's own statements and 13 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BurnChartCanvas.body (cognitive 31) Sources/CodexBarWidget/BurnDownWidgetViews.swift:320— BurnChartCanvas.body has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), ternaries 3 (5 pts), loops 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.
SpendProviderBreakdownRows.providerGroup (cognitive 30) Sources/CodexBar/SpendDashboard/SpendDashboardProviderBreakdown.swift:128— SpendProviderBreakdownRows.providerGroup has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 5 (10 pts), boolean chains 4 (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.
StatusItemController.tickBlink (cognitive 30) Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:122— StatusItemController.tickBlink has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), ternaries 1 (4 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.applySelectedOutcome (cognitive 30) Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:1467— UsageStore.applySelectedOutcome has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 8, ternaries 3 (6 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexThreadMetadataReader.tomlString (cognitive 30) Sources/CodexBarCore/CodexThreadMetadataReader.swift:327— CodexThreadMetadataReader.tomlString has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 3 (8 pts), boolean chains 5, loops 2 (3 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.
AntigravityCLIHTTPSFetchStrategy.waitForSnapshot (cognitive 30) Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:876— AntigravityCLIHTTPSFetchStrategy.waitForSnapshot has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (22 pts), error handling 3 (7 pts), 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.
CursorLocalCSVReader.parseFile (cognitive 30) Sources/CodexBarCore/Providers/Cursor/CursorLocalCSVReader.swift:46— CursorLocalCSVReader.parseFile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 7, ternaries 3 (6 pts), loops 2 (nesting depth added 8). Of this number, 23 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeepSeekPlatformTokenImporter.resolve (cognitive 30) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekPlatformTokenImporter.swift:139— DeepSeekPlatformTokenImporter.resolve has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 3 (6 pts), boolean chains 4, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GrokWebBillingFetcher.parseGRPCWebResponse (cognitive 30) Sources/CodexBarCore/Providers/Grok/GrokWebBillingFetcher.swift:312— GrokWebBillingFetcher.parseGRPCWebResponse has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 21, if/else 6, ternaries 2, loops 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MistralSubscriptionBudgetParser.collectModels (cognitive 30) Sources/CodexBarCore/Providers/Mistral/MistralSubscriptionBudgetParser.swift:91— MistralSubscriptionBudgetParser.collectModels has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 9, ternaries 2 (5 pts), 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.
ReplayEngine.runDetailed (cognitive 29) Sources/AdaptiveReplayKit/ReplayEngine.swift:53— ReplayEngine.runDetailed has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 8, ternaries 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.
SettingsStore.recoverLegacyCredentials (cognitive 29) Sources/CodexBar/Settings/SettingsStore+Config.swift:48— SettingsStore.recoverLegacyCredentials has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 16, if/else 5 (10 pts), error handling 1 (2 pts), loops 1 (nesting depth added 6). 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.
StatusItemController.scheduleMenuBarCountdownRefreshIfNeeded (cognitive 29) Sources/CodexBar/StatusItem/StatusItemController+CountdownRefresh.swift:7— StatusItemController.scheduleMenuBarCountdownRefreshIfNeeded has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 8, match/switch 1 (2 pts), error handling 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.
StatusItemController.menuWillOpen (cognitive 29) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:66— StatusItemController.menuWillOpen has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 4 (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.
CodexThreadMetadataReader.decodeMultilineBasicString (cognitive 29) Sources/CodexBarCore/CodexThreadMetadataReader.swift:373— CodexThreadMetadataReader.decodeMultilineBasicString has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (7 pts), boolean chains 6, ternaries 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexThreadMetadataReader.assignedProjectSessionIDs (cognitive 29) Sources/CodexBarCore/CodexThreadMetadataReader+Projects.swift:79— CodexThreadMetadataReader.assignedProjectSessionIDs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 3, loops 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.
CostUsageFetcher.loadLocalTokenScanResult (cognitive 29) Sources/CodexBarCore/CostUsageFetcher.swift:917— CostUsageFetcher.loadLocalTokenScanResult has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 14, if/else 9 (14 pts), 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.
Model.costHistoryInlineDashboard (cognitive 29) Sources/CodexBar/Menu/InlineUsageDashboardContent.swift:272— Model.costHistoryInlineDashboard has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 17, if/else 7 (8 pts), boolean chains 4 (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.
OpenAIDashboardWebViewCache.acquire (cognitive 29) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardWebViewCache.swift:316— OpenAIDashboardWebViewCache.acquire has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 5, error handling 1 (2 pts), 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.
OpenAISubscription.fetch (cognitive 29) Sources/CodexBarCore/OpenAIWeb/OpenAISubscriptionMetadata.swift:94— OpenAISubscription.fetch has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 2 (6 pts), boolean chains 5, 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.
TTYCommandRunner.run::processNonCodexChunk (cognitive 29) Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:743— TTYCommandRunner.run::processNonCodexChunk has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (TTYCommandRunner.run) 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.
AntigravityLocalReader.readRows (cognitive 29) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSQLite.swift:535— AntigravityLocalReader.readRows has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 4, 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.
AntigravityCLIHTTPSFetchStrategy.tryWarmAgyFetch (cognitive 29) Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:350— AntigravityCLIHTTPSFetchStrategy.tryWarmAgyFetch has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 6 (10 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexRequestLedger.validate (cognitive 29) Sources/CodexBarCore/Providers/Codex/CodexRequestLedger.swift:71— CodexRequestLedger.validate has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 23, if/else 3 (5 pts), loops 1 (nesting depth added 2). 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.
CursorStatusProbe.parseUsageSummary (cognitive 29) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe+UsageSummary.swift:5— CursorStatusProbe.parseUsageSummary has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15, boolean chains 8, ternaries 6. Of this number, 28 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
KiroUsageSnapshot.toUsageSnapshot (cognitive 29) Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:108— KiroUsageSnapshot.toUsageSnapshot has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 11, ternaries 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Recovery.repairFromClaudeKeychainWithoutPromptIfAllowed (cognitive 29) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1152— Recovery.repairFromClaudeKeychainWithoutPromptIfAllowed has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8, ternaries 3 (6 pts), error handling 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.
fetchUsage (cognitive 29) REDACTED:8— fetchUsage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 7, boolean chains 6, error handling 2, loops 1 (nesting depth added 2). Of this number, 16 points are the body's own statements and 13 belong to 5 function items inside it that branch. 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.
IconRenderer.makeIcon::drawBar (cognitive 28) Sources/CodexBar/IconRenderer.swift:168— IconRenderer.makeIcon::drawBar has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (24 pts), loops 1 (2 pts), ternaries 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. This shape REPEATS in the file: one other method here (IconRenderer.makeIcon) 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.
StatusItemController.performStoreRefresh (cognitive 28) Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:74— StatusItemController.performStoreRefresh has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 8 (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.
StatusItemController.startManualRefresh (cognitive 28) Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:180— StatusItemController.startManualRefresh has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 10, 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.
UsageStore.applyOpenAIDashboardAuthorityDecision (cognitive 28) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:231— UsageStore.applyOpenAIDashboardAuthorityDecision has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 7, ternaries 2 (5 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
CodexResetCreditExpiryNotifier.postExpiringCreditsIfNeeded (cognitive 28) Sources/CodexBar/Providers/Codex/CodexResetCreditExpiryNotifier.swift:19— CodexResetCreditExpiryNotifier.postExpiringCreditsIfNeeded has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 2 (5 pts), boolean chains 3, ternaries 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.
CodexWeeklyResetConfirmation.initialDecision (cognitive 28) Sources/CodexBar/Providers/Codex/CodexWeeklyResetConfirmation.swift:90— CodexWeeklyResetConfirmation.initialDecision has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexBarCLI.runCacheClear (cognitive 28) Sources/CodexBarCLI/CLICacheCommand.swift:6— CodexBarCLI.runCacheClear has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (2 pts), match/switch 1, 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.
CookieHeaderCache.currentObservationMatch (cognitive 28) Sources/CodexBarCore/CookieHeaderCache.swift:1396— CookieHeaderCache.currentObservationMatch has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 3 (7 pts), match/switch 3 (5 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.
PiSessionCostScanner.appendingPreviousSessionRoots (cognitive 28) Sources/CodexBarCore/PiSessionCostScanner.swift:496— PiSessionCostScanner.appendingPreviousSessionRoots has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 10, match/switch 1 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 24 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreferencesDocument.validate (cognitive 28) Sources/CodexBarCore/Config/PreferencesDocument.swift:134— PreferencesDocument.validate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 6, match/switch 1 (2 pts), 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.
ProviderIntentPayload.applying (cognitive 28) Sources/CodexBarCore/Sync/SyncModels.swift:77— ProviderIntentPayload.applying has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 4 (8 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.
AntigravityLocalReader.readJSONLFile (cognitive 28) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalJSONL.swift:24— AntigravityLocalReader.readJSONLFile has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 3 (4 pts), loops 2 (3 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.
DoubaoUsageFetcher.decodeArkcliUsage (cognitive 28) Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:504— DoubaoUsageFetcher.decodeArkcliUsage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (5 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MiniMaxUsageParser.parseCodingPlanRemains (cognitive 28) Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:788— MiniMaxUsageParser.parseCodingPlanRemains has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 10, ternaries 4 (5 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Repository.loadFromClaudeKeychainWithPromptIfAllowed (cognitive 28) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:542— Repository.loadFromClaudeKeychainWithPromptIfAllowed has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 6, error handling 3 (4 pts), match/switch 1 (3 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.
fetchUsage (cognitive 28) Sources/CodexBarCore/Resources/Plugins/fal.js:8— fetchUsage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9, ternaries 6 (9 pts), boolean chains 8, error handling 1, other 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.
MenuBarLayoutBalanceResolver.balance (cognitive 27) Sources/CodexBar/Menu/MenuBarLayout.swift:746— MenuBarLayoutBalanceResolver.balance has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 7, ternaries 2 (4 pts), 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.
StatusItemController.switcherWeeklyMetricPercent (cognitive 27) Sources/CodexBar/StatusItem/StatusItemController+SwitcherMetrics.swift:48— StatusItemController.switcherWeeklyMetricPercent has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, if/else 9, ternaries 3 (4 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CloudSyncEngine.processEvent (cognitive 27) Sources/CodexBar/Sync/CloudSyncEngine.swift:829— CloudSyncEngine.processEvent has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.emitUserPluginHooks (cognitive 27) Sources/CodexBar/UsageStore/UsageStore+UserPlugins.swift:119— UsageStore.emitUserPluginHooks has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 5 (9 pts), loops 2 (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.
UsageStore.widgetAccounts (cognitive 27) Sources/CodexBar/UsageStore/UsageStore+WidgetAccounts.swift:42— UsageStore.widgetAccounts has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, ternaries 3 (5 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.
CLIClaudeSwapText.sanitize (cognitive 27) Sources/CodexBarCLI/CLIClaudeSwapCards.swift:24— CLIClaudeSwapText.sanitize has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 2 (5 pts), ternaries 1 (3 pts), boolean chains 1, 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.
CodexBarCLI.runCodexIdentifiedUsage (cognitive 27) Sources/CodexBarCLI/CLICodexIdentifiedUsage.swift:27— CodexBarCLI.runCodexIdentifiedUsage has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 15, if/else 5 (6 pts), error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 3). 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.
Model.providerCostSection (cognitive 27) Sources/CodexBar/Menu/MenuCardView+Costs.swift:469— Model.providerCostSection has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 3, ternaries 3 (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.
AugmentSessionKeepalive.performRefreshPass (cognitive 27) Sources/CodexBarCore/Providers/Augment/AugmentSessionKeepalive.swift:266— AugmentSessionKeepalive.performRefreshPass has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), error handling 2, boolean chains 1, ternaries 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.
BedrockUsageFetcher.parseDailyResponse (cognitive 27) Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:364— BedrockUsageFetcher.parseDailyResponse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 8, 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.
FactoryStatusProbe.fetch (cognitive 27) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:635— FactoryStatusProbe.fetch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2 (6 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QoderCookieRouting.httpRequestRoute (cognitive 27) Sources/CodexBarCore/Providers/Qoder/QoderCookieRouting.swift:75— QoderCookieRouting.httpRequestRoute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuotaBurndownModel.init (cognitive 26) Sources/CodexBar/QuotaBurndownModel.swift:17— QuotaBurndownModel.init has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (12 pts), loops 1 (nesting depth added 5). 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.
ManualRefreshViewportMovementTracker.settlePendingGeometryChanges (cognitive 26) Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift:142— ManualRefreshViewportMovementTracker.settlePendingGeometryChanges has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (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.
StatusItemController.menuBarDisplayText (cognitive 26) Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:774— StatusItemController.menuBarDisplayText has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, if/else 8, ternaries 2 (3 pts), match/switch 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
UsageStore.runRefresh (cognitive 26) Sources/CodexBar/UsageStore/UsageStore.swift:755— UsageStore.runRefresh has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 5, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UsageStore.prepareLimitResetNotification (cognitive 26) Sources/CodexBar/LimitResetNotifications.swift:31— UsageStore.prepareLimitResetNotification has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 9 (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.
UsageStore.recordPlanUtilizationHistorySample (cognitive 26) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:210— UsageStore.recordPlanUtilizationHistorySample has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 7, ternaries 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.
UsageStore.refreshProviderPass (cognitive 26) Sources/CodexBar/UsageStore/UsageStore+Refresh.swift:294— UsageStore.refreshProviderPass has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 5, ternaries 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UsageStore.switchClaudeSwapAccount (cognitive 26) Sources/CodexBar/Providers/Claude/UsageStore+ClaudeSwapRefresh.swift:181— UsageStore.switchClaudeSwapAccount has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (9 pts), ternaries 3 (4 pts), loops 1 (2 pts), error handling 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.
UsageStore.shouldApplyCodexUsageResult (cognitive 26) Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:263— UsageStore.shouldApplyCodexUsageResult has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CLIServeOperationCoordinator.sourceProduced (cognitive 26) Sources/CodexBarCLI/CLIServeOperationCoordinator.swift:484— CLIServeOperationCoordinator.sourceProduced has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 9, loops 2 (5 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.
PiFamilySessionScanner.records (cognitive 26) Sources/CodexBarCore/PiFamilySessionScanner.swift:1234— PiFamilySessionScanner.records has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Model.tokenUsageSection (cognitive 26) Sources/CodexBar/Menu/MenuCardView+Costs.swift:208— Model.tokenUsageSection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 8, boolean chains 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OpenAIDashboardBrowserCookieImporter.evaluateCandidate (cognitive 26) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:581— OpenAIDashboardBrowserCookieImporter.evaluateCandidate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 2, error handling 2 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
OpenAIDashboardParser.parseSignedInEmailFromClientBootstrap (cognitive 26) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:9— OpenAIDashboardParser.parseSignedInEmailFromClientBootstrap has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 8, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuickJSProviderPluginEngine.hostCookieHeader (cognitive 26) Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:704— QuickJSProviderPluginEngine.hostCookieHeader has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 7, loops 2 (5 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AntigravityLocalReader.consumeJSONLLine (cognitive 26) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalJSONL.swift:85— AntigravityLocalReader.consumeJSONLLine has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 7, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AntigravityRemoteUsageFetcher.fetch (cognitive 26) Sources/CodexBarCore/Providers/Antigravity/AntigravityRemoteUsageFetcher.swift:100— AntigravityRemoteUsageFetcher.fetch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 7, error handling 2 (3 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.
ManagedCodexAccountCredentialResolver.resolve (cognitive 26) Sources/CodexBarCore/Providers/Codex/ManagedCodexAccountCredentialResolver.swift:155— ManagedCodexAccountCredentialResolver.resolve has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7, error handling 4, ternaries 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.
CopilotDeviceFlow.pollForToken (cognitive 26) Sources/CodexBarCore/Providers/Copilot/CopilotDeviceFlow.swift:115— CopilotDeviceFlow.pollForToken has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeepSeekUsageCostParser.buildBreakdowns (cognitive 26) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:626— DeepSeekUsageCostParser.buildBreakdowns has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 5 (7 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MuseLocalUsageReader.parseSessionLog (cognitive 26) Sources/CodexBarCore/Providers/Muse/MuseLocalUsageReader.swift:423— MuseLocalUsageReader.parseSessionLog has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts), match/switch 1 (nesting depth added 7). Of this number, 21 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OllamaUsageParser.looksSignedOut (cognitive 26) Sources/CodexBarCore/Providers/Ollama/OllamaUsageParser.swift:216— OllamaUsageParser.looksSignedOut has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 23, if/else 3. 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.
QoderCookieRouting.curlHeaderHostSites (cognitive 26) Sources/CodexBarCore/Providers/Qoder/QoderCookieRouting.swift:276— QoderCookieRouting.curlHeaderHostSites has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Recovery.syncWithClaudeKeychainIfChanged (cognitive 26) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1075— Recovery.syncWithClaudeKeychainIfChanged has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 7, error handling 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.
ClaudeOAuthRefreshFailureGate.reloadPersistedState (cognitive 26) REDACTED:374— ClaudeOAuthRefreshFailureGate.reloadPersistedState has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 8, ternaries 3 (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.
AliyunOneConsoleCookieImporter.importSession (cognitive 26) Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieImporter.swift:66— AliyunOneConsoleCookieImporter.importSession has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (17 pts), error handling 2 (4 pts), loops 2 (4 pts), 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.
StatusItemController.attachMenus (cognitive 25) Sources/CodexBar/StatusItem/StatusItemController.swift:834— StatusItemController.attachMenus has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 1, loops 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.
UsageStore.codexWeeklyResetDecision (cognitive 25) Sources/CodexBar/UsageStore/UsageStore+LimitResetCelebration.swift:461— UsageStore.codexWeeklyResetDecision has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 25. 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.
UsageStore.handleQuotaWarningTransition (cognitive 25) Sources/CodexBar/UsageStore/UsageStore+QuotaWarnings.swift:138— UsageStore.handleQuotaWarningTransition has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 10 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.hydrateCachedTokenSnapshots (cognitive 25) Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift:393— UsageStore.hydrateCachedTokenSnapshots has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 14, if/else 11. 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.
CursorLoginRunner.runUserInitiated (cognitive 25) Sources/CodexBar/Providers/Cursor/CursorLoginRunner.swift:210— CursorLoginRunner.runUserInitiated has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (21 pts), error handling 1 (2 pts), loops 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.
CLICardsRenderer.renderCard (cognitive 25) Sources/CodexBarCLI/CLICardsRenderer.swift:296— CLICardsRenderer.renderCard has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 5 (7 pts), boolean chains 3, ternaries 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.
CodexBarCLI.runCodexAccounts (cognitive 25) Sources/CodexBarCLI/CLICodexAccountsCommand.swift:27— CodexBarCLI.runCodexAccounts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (8 pts), loops 1 (4 pts), boolean chains 1, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexBarCLI.runHooksTest (cognitive 25) Sources/CodexBarCLI/CLIHooksCommand.swift:75— CodexBarCLI.runHooksTest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 4 (10 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexBarCLI.fetchPlugin (cognitive 25) Sources/CodexBarCLI/CLIPluginsCommand.swift:41— CodexBarCLI.fetchPlugin has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 1 (3 pts), boolean chains 2, error handling 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.
CodexBarCLI.handleServeRequest (cognitive 25) Sources/CodexBarCLI/CLIServeCommand.swift:858— CodexBarCLI.handleServeRequest has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (10 pts), error handling 4 (6 pts), boolean chains 4, if/else 2 (4 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexThreadMetadataReader.multilineQuote (cognitive 25) Sources/CodexBarCore/CodexThreadMetadataReader.swift:237— CodexThreadMetadataReader.multilineQuote has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (7 pts), match/switch 3 (4 pts), 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.
KeychainCacheStore.storeResult (cognitive 25) Sources/CodexBarCore/KeychainCacheStore.swift:171— KeychainCacheStore.storeResult has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 4, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Scanner.value (cognitive 25) Sources/CodexBarCore/Config/OpaqueConfigJSON.swift:82— Scanner.value has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, loops 2 (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.
AugmentSessionKeepalive.shouldRefreshSession (cognitive 25) Sources/CodexBarCore/Providers/Augment/AugmentSessionKeepalive.swift:184— AugmentSessionKeepalive.shouldRefreshSession has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 1 (4 pts), loops 1 (2 pts), error handling 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.
CodexDashboardAuthority.evaluate (cognitive 25) Sources/CodexBarCore/Providers/Codex/CodexDashboardAuthority.swift:170— CodexDashboardAuthority.evaluate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 3, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CopilotBudgetWebFetcher.normalizedBillingIdentifier (cognitive 25) Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:651— CopilotBudgetWebFetcher.normalizedBillingIdentifier has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 15, if/else 10. 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.
JetBrainsQuotaLogReader.latestEntry (cognitive 25) Sources/CodexBarCore/Providers/JetBrains/JetBrainsQuotaLogReader.swift:52— JetBrainsQuotaLogReader.latestEntry has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, ternaries 1 (3 pts), 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.
OpenAILiveUsageFetcher.fetch (cognitive 25) Sources/CodexBarCore/Providers/OpenAI/OpenAILiveUsageFetcher.swift:44— OpenAILiveUsageFetcher.fetch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (8 pts), boolean chains 2, error handling 1 (2 pts), match/switch 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.
BurnDownLayout.body (cognitive 25) Sources/CodexBarWidget/BurnDownWidgetViews.swift:66— BurnDownLayout.body has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 17, boolean chains 5, if/else 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.
chutes.chutesQuota (cognitive 25) Sources/CodexBarCore/Resources/Plugins/chutes.ts:149— chutes.chutesQuota has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (13 pts), boolean chains 8, if/else 4 (nesting depth added 5). Of this number, 15 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentSessionsStore.reconcilePeriodicTasks (cognitive 24) Sources/CodexBar/AgentSessionsStore.swift:289— AgentSessionsStore.reconcilePeriodicTasks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (6 pts), boolean chains 4, loops 2 (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.
PlanUtilizationHistoryChartMenuView.seriesPoints (cognitive 24) Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:331— PlanUtilizationHistoryChartMenuView.seriesPoints has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4 (8 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.
ProviderDetailView.body (cognitive 24) Sources/CodexBar/Settings/PreferencesProviderDetailView.swift:135— ProviderDetailView.body has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 2 (6 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.
SpendDashboardModel.inputSummary (cognitive 24) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:737— SpendDashboardModel.inputSummary has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, ternaries 7, if/else 3 (6 pts), 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.
StatusItemController.scheduleOpenMenuRefresh (cognitive 24) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1160— StatusItemController.scheduleOpenMenuRefresh has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 2 (4 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.
UsageStore.providerWithHighestUsage (cognitive 24) Sources/CodexBar/UsageStore/UsageStore+HighestUsage.swift:8— UsageStore.providerWithHighestUsage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 2 (5 pts), boolean chains 4, 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.
CodexBarCLI.dailyCostLines (cognitive 24) Sources/CodexBarCLI/CLICostCommand.swift:325— CodexBarCLI.dailyCostLines has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 4 (8 pts), boolean chains 4, 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.
CLIServeResponseCache.mergeLastGoodUsageItems (cognitive 24) Sources/CodexBarCLI/CLIServeCommand.swift:398— CLIServeResponseCache.mergeLastGoodUsageItems has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, loops 2, ternaries 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.
main.swift.top-level code (cognitive 24) Sources/CodexBarClaudeWatchdog/main.swift:9— main.swift.top-level code has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SignatureReader.digest (cognitive 24) Sources/CodexBarCore/CodexLaunchPreflight+SignatureIdentity.swift:55— SignatureReader.digest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (8 pts), boolean chains 6, 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.
CodexThreadCatalogReader.loadResult (cognitive 24) Sources/CodexBarCore/CodexThreadCatalogReader.swift:66— CodexThreadCatalogReader.loadResult has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 7, if/else 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalAgentSessionScanner.sessions (cognitive 24) Sources/CodexBarCore/LocalAgentSessionScanner.swift:375— LocalAgentSessionScanner.sessions has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 4 (7 pts), loops 3, 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.
PiSessionCostScanner.loadCachedDailyReportResult (cognitive 24) Sources/CodexBarCore/PiSessionCostScanner.swift:343— PiSessionCostScanner.loadCachedDailyReportResult has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 6, ternaries 2 (3 pts) (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.
UsagePace.weekly (cognitive 24) Sources/CodexBarCore/UsagePace.swift:60— UsagePace.weekly has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 6, ternaries 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.
ProviderPluginSnapshotMapper.aggregateCostUsageEntries (cognitive 24) Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:493— ProviderPluginSnapshotMapper.aggregateCostUsageEntries has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 4 (6 pts), boolean chains 5, 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.
AntigravityLocalReader.resolveStepTimestamps (cognitive 24) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSQLite.swift:493— AntigravityLocalReader.resolveStepTimestamps has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AntigravityLocalReader.inspectSQLiteTableSupport (cognitive 24) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSQLiteSchema.swift:21— AntigravityLocalReader.inspectSQLiteTableSupport has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, ternaries 2 (5 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.
ClaudeCLIScreen.write (cognitive 24) Sources/CodexBarCore/Providers/Claude/ClaudeCLIScreen.swift:59— ClaudeCLIScreen.write has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 11). 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.
ClaudeCLISession.workspaceTrustKeys (cognitive 24) Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:265— ClaudeCLISession.workspaceTrustKeys has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (10 pts), boolean chains 2, loops 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.
ClaudeStatusProbe.exactLocalOccurrences (cognitive 24) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:1130— ClaudeStatusProbe.exactLocalOccurrences has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 16, if/else 5 (7 pts), loops 1 (nesting depth added 2). 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.
IBMBobUsageFetcher.fetchUsage (cognitive 24) Sources/CodexBarCore/Providers/IBMBob/IBMBobUsageFetcher.swift:197— IBMBobUsageFetcher.fetchUsage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 pts), error handling 4, ternaries 1 (4 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.
KimiDesktopSessionDiscovery.accessToken (cognitive 24) Sources/CodexBarCore/Providers/Kimi/KimiDesktopSessionDiscovery.swift:55— KimiDesktopSessionDiscovery.accessToken has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 18, if/else 5 (6 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
KiroStatusProbe.runViaPipe (cognitive 24) Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:651— KiroStatusProbe.runViaPipe has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, error handling 2, 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.
KiroStatusProbe.parse (cognitive 24) Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:873— KiroStatusProbe.parse has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 9 (11 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.
OpenCodeLocalHistoryAdapter.runPass (cognitive 24) Sources/CodexBarCore/Providers/OpenCode/OpenCodeLocalHistoryAdapter.swift:206— OpenCodeLocalHistoryAdapter.runPass has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 16, 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.
ClaudeOAuthCredentialsStore.loadCodexBarOAuthKeychainCache (cognitive 24) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:2635— ClaudeOAuthCredentialsStore.loadCodexBarOAuthKeychainCache has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (19 pts), match/switch 2 (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.
Repository.invalidateCacheIfCredentialsFileChanged (cognitive 24) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:820— Repository.invalidateCacheIfCredentialsFileChanged has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 1 (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.
Recovery.syncFromClaudeKeychainWithoutPrompt (cognitive 24) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:1232— Recovery.syncFromClaudeKeychainWithoutPrompt has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, if/else 10 (12 pts) (nesting depth added 2). 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.
CLIArguments.parse (cognitive 23) Sources/AdaptiveReplayCLI/CLIArguments.swift:46— CLIArguments.parse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, match/switch 1 (2 pts), loops 1, 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.
SessionEquivalentBurnEstimator.normalizedBurn (cognitive 23) Sources/CodexBar/SessionEquivalentForecast.swift:286— SessionEquivalentBurnEstimator.normalizedBurn has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (9 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SpendDashboardController.startLoad (cognitive 23) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:1308— SpendDashboardController.startLoad has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, loops 1 (2 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ProviderSwitcherView.init (cognitive 23) Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:48— ProviderSwitcherView.init has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 6 (7 pts), boolean chains 3, loops 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 8 belong to one function item inside it that branches. 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.
StatusItemController.hydrateHostedSubviewMenuIfNeeded (cognitive 23) Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:91— StatusItemController.hydrateHostedSubviewMenuIfNeeded has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 7, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.planUtilizationIdentityAccountKey (cognitive 23) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:812— UsageStore.planUtilizationIdentityAccountKey has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4 (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.
CLILocalHTTPServer.run (cognitive 23) Sources/CodexBarCLI/CLILocalHTTPServer.swift:328— CLILocalHTTPServer.run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3, 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.
CostUsageFetcher.unknownPricingRefreshRequest (cognitive 23) Sources/CodexBarCore/CostUsageFetcher.swift:1261— CostUsageFetcher.unknownPricingRefreshRequest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (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.
ProviderDiagnosticFetchAttempt.errorCategoryLabel (cognitive 23) Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift:328— ProviderDiagnosticFetchAttempt.errorCategoryLabel has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 16, if/else 7. 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.
CursorStatusSnapshot.toUsageSnapshot (cognitive 23) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:448— CursorStatusSnapshot.toUsageSnapshot has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 7, ternaries 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CursorStatusProbe.fetchWithCookieHeader (cognitive 23) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:1204— CursorStatusProbe.fetchWithCookieHeader has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7, error handling 1 (2 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MistralUsageSnapshot.toCostUsageTokenSnapshot (cognitive 23) Sources/CodexBarCore/Providers/Mistral/MistralModels.swift:264— MistralUsageSnapshot.toCostUsageTokenSnapshot has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, ternaries 10. 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.
OpenAILiveUsageBuilder.build (cognitive 23) Sources/CodexBarCore/Providers/OpenAI/OpenAILiveUsageBuilder.swift:5— OpenAILiveUsageBuilder.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 8, loops 2 (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.
OpenAIOrgRateLimitsFetcher.pages (cognitive 23) Sources/CodexBarCore/Providers/OpenAI/OpenAIOrgRateLimitsFetcher.swift:64— OpenAIOrgRateLimitsFetcher.pages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenCodeGoUsageFetcher.parseWindow (cognitive 23) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:704— OpenCodeGoUsageFetcher.parseWindow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, ternaries 3 (6 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.
OpenCodeSubscriptionParser.parseUsageNested (cognitive 23) Sources/CodexBarCore/Providers/Shared/OpenCodeSubscriptionParser.swift:65— OpenCodeSubscriptionParser.parseUsageNested has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 9, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OneConsoleCookieRouting.redirectedRequest (cognitive 23) Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleCookieRouting.swift:31— OneConsoleCookieRouting.redirectedRequest has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 10 (11 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CombinedBurnRow.body (cognitive 23) Sources/CodexBarWidget/CombinedBurnDownWidgetViews.swift:141— CombinedBurnRow.body has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 15, if/else 7, boolean chains 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.
fetchUsage (cognitive 23) Sources/CodexBarCore/Resources/Plugins/tavily.js:8— fetchUsage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 7, error handling 1. Of this number, 16 points are the body's own statements and 7 belong to 6 function items inside it that branch. 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.
CloudSyncEngine.pushPendingSnapshots (cognitive 22) Sources/CodexBar/Sync/CloudSyncEngine.swift:1451— CloudSyncEngine.pushPendingSnapshots has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (2 pts), boolean chains 1, error handling 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.
UsageStore.presentationSnapshot (cognitive 22) Sources/CodexBar/UsageStore/UsageStore+Accessors.swift:42— UsageStore.presentationSnapshot has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (11 pts) (nesting depth added 5). 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.
UsageStore.handleCredentialOutcome (cognitive 22) Sources/CodexBar/UsageStore/UsageStore+CredentialNotifications.swift:50— UsageStore.handleCredentialOutcome has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 10, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.debugClaudeLog (cognitive 22) Sources/CodexBar/Providers/Claude/UsageStore+ClaudeDebug.swift:24— UsageStore.debugClaudeLog has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 1 (2 pts), match/switch 1, ternaries 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.
CodexWorkspaceUsageSidecar.loadLatestSnapshot (cognitive 22) Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:73— CodexWorkspaceUsageSidecar.loadLatestSnapshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8 (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.
CostUsageTokenSnapshot.quotaWindowCoverage (cognitive 22) Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:523— CostUsageTokenSnapshot.quotaWindowCoverage has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 12, if/else 4 (9 pts), loops 1 (nesting depth added 5). 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.
KeychainAccessPreflight.evaluateDecryptACL (cognitive 22) Sources/CodexBarCore/KeychainAccessPreflight.swift:347— KeychainAccessPreflight.evaluateDecryptACL has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, match/switch 1 (2 pts), loops 1, ternaries 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.
WidgetExtensionRecovery.launch (cognitive 22) Sources/CodexBarCore/WidgetExtensionRecovery.swift:40— WidgetExtensionRecovery.launch has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 17, if/else 5. 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.
ProviderPluginPersistentCookies.next (cognitive 22) Sources/CodexBarCore/Plugins/ProviderPluginPersistentCookies.swift:41— ProviderPluginPersistentCookies.next has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderFetchPipeline.fetch (cognitive 22) Sources/CodexBarCore/Providers/ProviderFetchPlan.swift:396— ProviderFetchPipeline.fetch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AlibabaTokenPlanUsageFetcher.throwIfErrorPayload (cognitive 22) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:728— AlibabaTokenPlanUsageFetcher.throwIfErrorPayload has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AntigravityCLISession.finishProbe (cognitive 22) Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:306— AntigravityCLISession.finishProbe has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 8 (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.
AugmentSessionKeepalive.attemptSessionRecovery (cognitive 22) Sources/CodexBarCore/Providers/Augment/AugmentSessionKeepalive.swift:342— AugmentSessionKeepalive.attemptSessionRecovery has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ClaudeOAuthFetchStrategy.isPlausiblyAvailable (cognitive 22) Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:661— ClaudeOAuthFetchStrategy.isPlausiblyAvailable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, match/switch 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.
ClaudeStatusProbe.extractScopedWeeklyUsages (cognitive 22) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:470— ClaudeStatusProbe.extractScopedWeeklyUsages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DevinUsageParser.percent (cognitive 22) Sources/CodexBarCore/Providers/Devin/DevinUsageSnapshot.swift:204— DevinUsageParser.percent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (8 pts), boolean chains 4, 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.
GeminiStatusProbe.fetchViaAPI (cognitive 22) Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:268— GeminiStatusProbe.fetchViaAPI has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GrokWebFetchStrategy.fetchLegacyWebBilling (cognitive 22) Sources/CodexBarCore/Providers/Grok/GrokProviderDescriptor.swift:577— GrokWebFetchStrategy.fetchLegacyWebBilling has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 3 (6 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KiloUsageFetcher.parseOrganizations (cognitive 22) Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:358— KiloUsageFetcher.parseOrganizations has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeOAuthRefreshFailureGate.shouldAttempt (cognitive 22) REDACTED:141— ClaudeOAuthRefreshFailureGate.shouldAttempt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 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.
SessionEquivalentForecast.make (cognitive 21) Sources/CodexBar/SessionEquivalentForecast.swift:40— SessionEquivalentForecast.make has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PlanUtilizationHistoryChartMenuView.updateSelection (cognitive 21) Sources/CodexBar/Menu/PlanUtilizationHistoryChartMenuView.swift:785— PlanUtilizationHistoryChartMenuView.updateSelection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpendDashboardModel.hasConsistentCostHistory (cognitive 21) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:997— SpendDashboardModel.hasConsistentCostHistory has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, 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.
SpendDashboardModel.hourlyPoints (cognitive 21) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1579— SpendDashboardModel.hourlyPoints has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpendTrendChart.chart (cognitive 21) Sources/CodexBar/SpendDashboard/SpendDashboardTrendPanel.swift:272— SpendTrendChart.chart has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 5 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SpendToolOperationRow.body (cognitive 21) Sources/CodexBar/SpendDashboard/SpendSessionToolActivityView.swift:225— SpendToolOperationRow.body has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 3 (5 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.
StatusItemController.addMenuCardSections (cognitive 21) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:1292— StatusItemController.addMenuCardSections has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, ternaries 3 (5 pts) (nesting depth added 3). Of this number, 20 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
UsageStore.refreshTokenAccounts (cognitive 21) Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:514— UsageStore.refreshTokenAccounts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.debugLog (cognitive 21) Sources/CodexBar/UsageStore/UsageStore.swift:1033— UsageStore.debugLog has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 6 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexBarCLI.runCodexHostCosts (cognitive 21) Sources/CodexBarCLI/CLICodexHostCosts.swift:6— CodexBarCLI.runCodexHostCosts has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), error handling 2 (3 pts), ternaries 2 (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.
CodexBarCLI.renderCostText (cognitive 21) Sources/CodexBarCLI/CLICostCommand.swift:191— CodexBarCLI.renderCostText has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 5 (6 pts) (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.
CodexBarCLI.collectAccountUsage (cognitive 21) Sources/CodexBarCLI/DashboardAccountCollector.swift:98— CodexBarCLI.collectAccountUsage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (4 pts), ternaries 1 (4 pts), error handling 1 (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.
CostUsageFetcher.codexScanProgressKey (cognitive 21) Sources/CodexBarCore/CostUsageFetcher.swift:2044— CostUsageFetcher.codexScanProgressKey has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 8 (10 pts) (nesting depth added 7). 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.
CostUsageTokenSnapshot.quotaHourlyResidualSlices (cognitive 21) Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:429— CostUsageTokenSnapshot.quotaHourlyResidualSlices has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 8, loops 1, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Model.visibleProviderDetails (cognitive 21) Sources/CodexBar/Menu/MenuCardView+ProviderDetailVisibility.swift:5— Model.visibleProviderDetails has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionToolActivityParser.operation (cognitive 21) Sources/CodexBarCore/SessionToolActivityParser.swift:13— SessionToolActivityParser.operation has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 15, ternaries 3, if/else 2, match/switch 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SessionWindowFocuser.application (cognitive 21) Sources/CodexBarCore/SessionWindowFocuser.swift:47— SessionWindowFocuser.application has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageLimitsAvailability.resolve (cognitive 21) Sources/CodexBarCore/UsageFetcher.swift:765— UsageLimitsAvailability.resolve has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (7 pts), boolean chains 6 (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.
OpenAIDashboardParser.parseResetDate (cognitive 21) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:358— OpenAIDashboardParser.parseResetDate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 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.
ProcessPipeCapture.handleLinuxReadableData (cognitive 21) Sources/CodexBarCore/Host/Process/ProcessPipeCapture.swift:216— ProcessPipeCapture.handleLinuxReadableData has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, 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.
OAuthExecutor.load (cognitive 21) Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:269— OAuthExecutor.load has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 6, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MistralSubscriptionBudgetParser.jsonContainerEnd (cognitive 21) Sources/CodexBarCore/Providers/Mistral/MistralSubscriptionBudgetParser.swift:148— MistralSubscriptionBudgetParser.jsonContainerEnd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CacheBox.read (cognitive 21) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoLocalUsageReader.swift:268— CacheBox.read has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Aggregate.init (cognitive 21) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoLocalUsageReader.swift:334— Aggregate.init has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (6 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.
OpenCodeGoZenBalanceParser.findRawBillingBalance (cognitive 21) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoZenBalanceParser.swift:94— OpenCodeGoZenBalanceParser.findRawBillingBalance has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QoderCookieRouting.shellTokens (cognitive 21) Sources/CodexBarCore/Providers/Qoder/QoderCookieRouting.swift:566— QoderCookieRouting.shellTokens has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, 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.
VertexAITokenRefresher.refresh (cognitive 21) Sources/CodexBarCore/Providers/VertexAI/VertexAIOAuth/VertexAITokenRefresher.swift:33— VertexAITokenRefresher.refresh has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (4 pts), boolean chains 2, error handling 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageMenuCardUsageContentView.body (cognitive 20) Sources/CodexBar/Menu/MenuCardView.swift:663— UsageMenuCardUsageContentView.body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MenuDescriptor.build (cognitive 20) Sources/CodexBar/Menu/MenuDescriptor.swift:91— MenuDescriptor.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpendDashboardController.publishCurrentState (cognitive 20) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:1748— SpendDashboardController.publishCurrentState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 2 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SpendModelRankingRows.body (cognitive 20) Sources/CodexBar/SpendDashboard/SpendDashboardModelRanking.swift:100— SpendModelRankingRows.body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 1 (4 pts), boolean chains 2 (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.
SpendDashboardPublication.coverageSources (cognitive 20) Sources/CodexBar/SpendDashboard/SpendDashboardPublication.swift:153— SpendDashboardPublication.coverageSources has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 14, if/else 5, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProviderSwitcherView.applyLayout (cognitive 20) Sources/CodexBar/StatusItem/StatusItemController+SwitcherViews.swift:349— ProviderSwitcherView.applyLayout has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 4 (9 pts), loops 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.
UsageStore.scheduleCodexWeeklyResetFollowUp (cognitive 20) Sources/CodexBar/Providers/Codex/UsageStore+CodexWeeklyResetCandidatePersistence.swift:75— UsageStore.scheduleCodexWeeklyResetFollowUp has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (8 pts), loops 2, error handling 1 (nesting depth added 2). 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.
KiloProviderImplementation.settingsOrganizations (cognitive 20) Sources/CodexBar/Providers/Kilo/KiloProviderImplementation.swift:91— KiloProviderImplementation.settingsOrganizations has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, error handling 4, loops 1, match/switch 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAILiveUsageModel.refresh (cognitive 20) Sources/CodexBar/Providers/OpenAI/OpenAILiveUsageModel.swift:121— OpenAILiveUsageModel.refresh has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexBarCLI.runConfigPreferences (cognitive 20) Sources/CodexBarCLI/CLIConfigPreferences.swift:21— CodexBarCLI.runConfigPreferences has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CLILocalHTTPRequest.parse (cognitive 20) Sources/CodexBarCLI/CLILocalHTTPServer.swift:39— CLILocalHTTPRequest.parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (4 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserCookieAccessGate.shouldAttemptWithPolicy (cognitive 20) Sources/CodexBarCore/BrowserCookieAccessGate.swift:108— BrowserCookieAccessGate.shouldAttemptWithPolicy has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (20 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.
ShellCommandLocator.runShellCommand (cognitive 20) Sources/CodexBarCore/PathEnvironment.swift:889— ShellCommandLocator.runShellCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 5, boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
PiSessionCostScanner.scanPiSessionFile (cognitive 20) Sources/CodexBarCore/PiSessionCostScanner.swift:745— PiSessionCostScanner.scanPiSessionFile has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (8 pts) (nesting depth added 2). 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.
Model.hasCompatibleTrackedLayout (cognitive 20) Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:426— Model.hasCompatibleTrackedLayout has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 18, if/else 2. 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.
TailscaleStatusParser.parseHosts (cognitive 20) Sources/CodexBarCore/RemoteSessionFetcher.swift:29— TailscaleStatusParser.parseHosts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SubprocessRunner.run (cognitive 20) Sources/CodexBarCore/Host/Process/SubprocessRunner.swift:133— SubprocessRunner.run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, ternaries 3, error handling 2 (nesting depth added 4). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AlibabaTokenPlanWebFetchStrategy.resolveCookieHeaders (cognitive 20) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:230— AlibabaTokenPlanWebFetchStrategy.resolveCookieHeaders has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 5 (7 pts), boolean chains 4, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmpUsageParser.extractObject (cognitive 20) Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift:227— AmpUsageParser.extractObject has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AugmentStatusProbe.fetch (cognitive 20) Sources/CodexBarCore/Providers/Augment/AugmentStatusProbe.swift:360— AugmentStatusProbe.fetch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 4 (7 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 7). 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.
BedrockCloudWatchUsageFetcher.parsePage (cognitive 20) Sources/CodexBarCore/Providers/Bedrock/BedrockCloudWatchUsage.swift:196— BedrockCloudWatchUsageFetcher.parsePage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 2 (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.
ClaudeCLIScreen.applyCSI (cognitive 20) Sources/CodexBarCore/Providers/Claude/ClaudeCLIScreen.swift:86— ClaudeCLIScreen.applyCSI has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 4, if/else 4, loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeDesktopProjectsLocator.roots (cognitive 20) Sources/CodexBarCore/Providers/Claude/ClaudeDesktopProjectsLocator.swift:32— ClaudeDesktopProjectsLocator.roots has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 5, loops 2 (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.
ClaudeCLIFetchStrategy.fetch (cognitive 20) Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:1129— ClaudeCLIFetchStrategy.fetch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 9, error handling 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.
CodexCLIBackendConfiguration.init (cognitive 20) Sources/CodexBarCore/Providers/Codex/CodexCLIBackendConfiguration.swift:61— CodexCLIBackendConfiguration.init has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, match/switch 1 (2 pts), loops 1, ternaries 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.
CodexRequestLedger.merge (cognitive 20) Sources/CodexBarCore/Providers/Codex/CodexRequestLedger.swift:347— CodexRequestLedger.merge has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 3 (4 pts), ternaries 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.
CopilotBudgetWebFetcher.fetchBudgetWindows (cognitive 20) Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:354— CopilotBudgetWebFetcher.fetchBudgetWindows has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (4 pts), boolean chains 2, 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.
CopilotBudgetWebFetcher.extractMetaContent (cognitive 20) Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:562— CopilotBudgetWebFetcher.extractMetaContent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, loops 3 (4 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.
CursorStatusProbe.fetchBrowserLoginCandidates (cognitive 20) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:933— CursorStatusProbe.fetchBrowserLoginCandidates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (4 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CursorStatusProbe.fetchTeamSpend (cognitive 20) Sources/CodexBarCore/Providers/Cursor/CursorTeamSpend.swift:65— CursorStatusProbe.fetchTeamSpend has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeepSeekUsageCostParser.decodeByAPIKeyPayloads (cognitive 20) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:923— DeepSeekUsageCostParser.decodeByAPIKeyPayloads has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DoubaoUsageFetcher.apiErrorSummary (cognitive 20) Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:839— DoubaoUsageFetcher.apiErrorSummary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, ternaries 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FactoryStatusProbe.attemptWorkOSCookies (cognitive 20) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:850— FactoryStatusProbe.attemptWorkOSCookies has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (10 pts), error handling 2 (6 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MiMoFirefoxSessionCookieImporter.decodeLZ4Block (cognitive 20) Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:592— MiMoFirefoxSessionCookieImporter.decodeLZ4Block has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (3 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.
MiniMaxCodingPlanFetchStrategy.fetch (cognitive 20) Sources/CodexBarCore/Providers/MiniMax/MiniMaxProviderDescriptor.swift:220— MiniMaxCodingPlanFetchStrategy.fetch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 2 (4 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.
QwenCloudWebFetchStrategy.resolveCookieHeaders (cognitive 20) Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:157— QwenCloudWebFetchStrategy.resolveCookieHeaders has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 5 (7 pts), boolean chains 4, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Repository.hasCachedCredentials (cognitive 20) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:900— Repository.hasCachedCredentials has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (9 pts), match/switch 2 (nesting depth added 2). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
ClaudeSwapAccountProjection.usageSnapshot (cognitive 20) Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountProjection.swift:154— ClaudeSwapAccountProjection.usageSnapshot has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 1 (3 pts), match/switch 1 (nesting depth added 11). 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.
VertexAIUsageFetcher.fetchTimeSeries (cognitive 20) Sources/CodexBarCore/Providers/VertexAI/VertexAIOAuth/VertexAIUsageFetcher.swift:214— VertexAIUsageFetcher.fetchTimeSeries has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 1 (2 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MenuBarLayoutPersistence.preferredLayout (cognitive 19) Sources/CodexBar/Menu/MenuBarLayout.swift:1134— MenuBarLayoutPersistence.preferredLayout has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 7 (8 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.
MetricRow.body (cognitive 19) Sources/CodexBar/Menu/MenuCardMetricRow.swift:19— MetricRow.body has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 6 (8 pts), boolean chains 3 (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.
SpendDashboardPane.codexCostCatchUpPanel (cognitive 19) Sources/CodexBar/Settings/PreferencesSpendDashboardPane.swift:276— SpendDashboardPane.codexCostCatchUpPanel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, ternaries 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.
SpendDashboardModel.hasRetainablePartialCodexModelCostCoverage (cognitive 19) Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:233— SpendDashboardModel.hasRetainablePartialCodexModelCostCoverage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, 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.
StatusItemController.scheduleDeferredMenuInteractionRefreshIfNeeded (cognitive 19) Sources/CodexBar/StatusItem/StatusItemController+MenuInteractionRefresh.swift:112— StatusItemController.scheduleDeferredMenuInteractionRefreshIfNeeded has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 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.
StatusItemController.scheduleManualRefreshViewportRestore (cognitive 19) Sources/CodexBar/StatusItem/StatusItemController+MenuViewportRestore.swift:510— StatusItemController.scheduleManualRefreshViewportRestore has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatusItemController.handleOverviewScrollWheel (cognitive 19) Sources/CodexBar/StatusItem/StatusItemController+OverviewScroll.swift:17— StatusItemController.handleOverviewScrollWheel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 2 (4 pts), 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.
UsageStore.postLimitResetCelebrationIfNeeded (cognitive 19) Sources/CodexBar/UsageStore/UsageStore+LimitResetCelebration.swift:181— UsageStore.postLimitResetCelebrationIfNeeded has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, match/switch 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.widgetUsageRows (cognitive 19) Sources/CodexBar/UsageStore/UsageStore+WidgetSnapshot.swift:466— UsageStore.widgetUsageRows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, ternaries 2 (3 pts) (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.
UsageStore.resolvedCodexRefreshOutcome (cognitive 19) Sources/CodexBar/Providers/Codex/UsageStore+CodexPATRefresh.swift:46— UsageStore.resolvedCodexRefreshOutcome has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 9 (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.
CodexConsumerProjection.make (cognitive 19) Sources/CodexBar/Providers/Codex/CodexConsumerProjection.swift:275— CodexConsumerProjection.make has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, ternaries 6, if/else 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CodexWeeklyResetConfirmation.resetCreditEvidence (cognitive 19) Sources/CodexBar/Providers/Codex/CodexWeeklyResetConfirmation.swift:463— CodexWeeklyResetConfirmation.resetCreditEvidence has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 13, if/else 3, ternaries 2 (3 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
OpenAIAPIProviderImplementation.throughputPresentation (cognitive 19) Sources/CodexBar/Providers/OpenAI/OpenAIAPIProviderImplementation.swift:75— OpenAIAPIProviderImplementation.throughputPresentation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CLILocalHTTPRequest.isAllowedHost (cognitive 19) Sources/CodexBarCLI/CLILocalHTTPServer.swift:117— CLILocalHTTPRequest.isAllowedHost has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 3 (5 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.
CLIServeResponseCache.mergeLastGoodCostItems (cognitive 19) Sources/CodexBarCLI/CLIServeCommand.swift:491— CLIServeResponseCache.mergeLastGoodCostItems has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, loops 1, ternaries 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.
TokenAccountCLIContext.resolvedAccounts (cognitive 19) Sources/CodexBarCLI/TokenAccountCLI.swift:89— TokenAccountCLIContext.resolvedAccounts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6 (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.
AgentSessionNameFormatter.agentPath (cognitive 19) Sources/CodexBarCore/AgentSession.swift:690— AgentSessionNameFormatter.agentPath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexModelsAnalyticsBuilder.parityMismatches (cognitive 19) Sources/CodexBarCore/CodexModelsAnalyticsModels.swift:708— CodexModelsAnalyticsBuilder.parityMismatches has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 8, ternaries 2, loops 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.
CodexThreadMetadataReader.projectMetadata (cognitive 19) Sources/CodexBarCore/CodexThreadMetadataReader+Projects.swift:12— CodexThreadMetadataReader.projectMetadata has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PiFamilySessionScanner.ompSessionRootResolution (cognitive 19) Sources/CodexBarCore/PiFamilySessionScanner.swift:853— PiFamilySessionScanner.ompSessionRootResolution has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 7, loops 2 (3 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProviderStorageScanner.scanDirectory (cognitive 19) Sources/CodexBarCore/ProviderStorageFootprint.swift:444— ProviderStorageScanner.scanDirectory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, loops 1, ternaries 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.
Model.applyingUsageItemVisibility (cognitive 19) Sources/CodexBar/ProviderUsageItemVisibility.swift:188— Model.applyingUsageItemVisibility has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, ternaries 1 (2 pts) (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.
SessionToolJSONProjection.punctuation (cognitive 19) Sources/CodexBarCore/SessionToolJSONProjection.swift:117— SessionToolJSONProjection.punctuation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderPluginIconSVG.hasBoundedCanvas (cognitive 19) Sources/CodexBarCore/Plugins/ProviderPluginIconSVG.swift:43— ProviderPluginIconSVG.hasBoundedCanvas has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (6 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 3). 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.
JavaScriptCoreProviderPluginEngine.makeCookieBlock (cognitive 19) Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift:954— JavaScriptCoreProviderPluginEngine.makeCookieBlock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2 (4 pts), boolean chains 2, error handling 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.
ClaudeUsageFetcher.applyWebExtrasIfNeeded (cognitive 19) Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:1257— ClaudeUsageFetcher.applyWebExtrasIfNeeded has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, ternaries 1 (2 pts), 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.
StepExecutor.loadViaCLI (cognitive 19) Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift:603— StepExecutor.loadViaCLI has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 2 (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.
CodexDisplacedLivePreservationExecutor.refreshExistingManagedAccount (cognitive 19) Sources/CodexBarCore/Providers/Codex/CodexAccountPromotionExecution.swift:203— CodexDisplacedLivePreservationExecutor.refreshExistingManagedAccount has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 3 (4 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.
CodexVisibleAccountProjection.make (cognitive 19) Sources/CodexBarCore/Providers/Codex/CodexVisibleAccountProjection.swift:206— CodexVisibleAccountProjection.make has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, match/switch 2 (3 pts), loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DeepSeekUsageCostParser.parse (cognitive 19) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:296— DeepSeekUsageCostParser.parse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DoubaoUsageFetcher.fetchCodingPlanUsage (cognitive 19) Sources/CodexBarCore/Providers/Doubao/DoubaoUsageFetcher.swift:302— DoubaoUsageFetcher.fetchCodingPlanUsage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, error handling 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MiMoWebFetchStrategy.fetchFromWeb (cognitive 19) Sources/CodexBarCore/Providers/MiMo/MiMoProviderDescriptor.swift:112— MiMoWebFetchStrategy.fetchFromWeb has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (4 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.
MiniMaxUsageFetcher.fetchUsageOnce (cognitive 19) Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:142— MiniMaxUsageFetcher.fetchUsageOnce has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OllamaUsageFetcher.fetchUsingCookieCandidates (cognitive 19) Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:465— OllamaUsageFetcher.fetchUsingCookieCandidates has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), error handling 4 (7 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.
ReplicateWebFetchStrategy.fetch (cognitive 19) Sources/CodexBarCore/Providers/Replicate/ReplicateWebFetchStrategy.swift:51— ReplicateWebFetchStrategy.fetch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeOAuthCredentialsStore.loadFromClaudeKeychainUsingSecurityFramework (cognitive 19) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:2236— ClaudeOAuthCredentialsStore.loadFromClaudeKeychainUsingSecurityFramework has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, error handling 2 (3 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.
ClaudeOAuthCredentialsStore.claudeKeychainCandidatesProbeWithoutPrompt (cognitive 19) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:2309— ClaudeOAuthCredentialsStore.claudeKeychainCandidatesProbeWithoutPrompt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ClaudeWebAPIFetcher.extractSessionKeyInfo (cognitive 19) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:531— ClaudeWebAPIFetcher.extractSessionKeyInfo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), error handling 1 (2 pts), ternaries 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.
ClaudeWebAPIFetcher.extractNotableFields (cognitive 19) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:1003— ClaudeWebAPIFetcher.extractNotableFields has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (5 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 7). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 2 function items inside it that branch (walk, appendValue). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
OllamaUsageFetcher.swift.normalizedOllamaTokenAccountHeader (cognitive 19) Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift:37— OllamaUsageFetcher.swift.normalizedOllamaTokenAccountHeader has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 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.
WidgetUsageRow.rows (cognitive 19) Sources/CodexBarWidget/CodexBarWidgetViews.swift:364— WidgetUsageRow.rows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (5 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShareStatsBuilder.make (cognitive 18) Sources/CodexBar/ShareStatsPayload.swift:216— ShareStatsBuilder.make has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), ternaries 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MenuBarLayoutPersistence.preferredOverrides (cognitive 18) Sources/CodexBar/Menu/MenuBarLayout.swift:1178— MenuBarLayoutPersistence.preferredOverrides has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 8 (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.
UsageBreakdownChartMenuView.makeModel (cognitive 18) Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:223— UsageBreakdownChartMenuView.makeModel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (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.
SettingsStore.init (cognitive 18) Sources/CodexBar/Settings/SettingsStore.swift:310— SettingsStore.init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SpendDashboardController.update (cognitive 18) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:1257— SpendDashboardController.update has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpendDashboardModel.tokenActivityInputSummary (cognitive 18) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1239— SpendDashboardModel.tokenActivityInputSummary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatusItemController.applyIcon (cognitive 18) Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:243— StatusItemController.applyIcon has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatusItemController.addCompactAccountMenuRows (cognitive 18) Sources/CodexBar/StatusItem/StatusItemController+CompactAccountMenu.swift:101— StatusItemController.addCompactAccountMenuRows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), boolean chains 1, 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.
StatusItemController.refreshHostedSubviewMenu (cognitive 18) Sources/CodexBar/StatusItem/StatusItemController+HostedSubmenus.swift:163— StatusItemController.refreshHostedSubviewMenu has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.scheduleStorageFootprintRefresh (cognitive 18) Sources/CodexBar/UsageStore/UsageStore+ProviderStorage.swift:86— UsageStore.scheduleStorageFootprintRefresh has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8 (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.
UsageStore.loadLatestCodexCredits (cognitive 18) Sources/CodexBar/Providers/Codex/UsageStore+CodexRefresh.swift:218— UsageStore.loadLatestCodexCredits has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 1 (3 pts), error handling 1 (2 pts), boolean chains 1, 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.
UsageStore.codexOutcomeAdmittedForPublication (cognitive 18) Sources/CodexBar/Providers/Codex/UsageStore+CodexWeeklyResetConfirmation.swift:31— UsageStore.codexOutcomeAdmittedForPublication has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, match/switch 3 (4 pts), boolean chains 3, ternaries 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UsageStore.openAIDashboardFriendlyError (cognitive 18) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:1539— UsageStore.openAIDashboardFriendlyError has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 12, if/else 4 (5 pts), ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AntigravityLoginRunner.run (cognitive 18) Sources/CodexBar/Providers/Antigravity/AntigravityLoginRunner.swift:24— AntigravityLoginRunner.run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 4, 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.
CodexAccountSwitcherView.compactButtonTitle (cognitive 18) Sources/CodexBar/Providers/Codex/CodexAccountSwitcherView.swift:137— CodexAccountSwitcherView.compactButtonTitle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManagedCodexAccountService.authenticateManagedAccount (cognitive 18) Sources/CodexBar/Providers/Codex/ManagedCodexAccountService.swift:229— ManagedCodexAccountService.authenticateManagedAccount has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, match/switch 1 (2 pts), error handling 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.
CodexBarCLI.runHooksWatch (cognitive 18) Sources/CodexBarCLI/CLIHooksWatchCommand.swift:14— CodexBarCLI.runHooksWatch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 pts), match/switch 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.
ToonSerializer.looksNumeric (cognitive 18) Sources/CodexBarCLI/ToonFormatter.swift:402— ToonSerializer.looksNumeric has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, loops 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexModelsAnalyticsBuilder.modelParityMismatches (cognitive 18) Sources/CodexBarCore/CodexModelsAnalyticsModels.swift:793— CodexModelsAnalyticsBuilder.modelParityMismatches has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Entry.coverageCounts (cognitive 18) Sources/CodexBarCore/CostUsageModels.swift:594— Entry.coverageCounts has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 6, if/else 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.
PiFamilySessionScanner.piSessionRootResolution (cognitive 18) Sources/CodexBarCore/PiFamilySessionScanner.swift:957— PiFamilySessionScanner.piSessionRootResolution has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 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.
PiSessionCostScanner.cachedSourceFilesAreCurrent (cognitive 18) Sources/CodexBarCore/PiSessionCostScanner.swift:633— PiSessionCostScanner.cachedSourceFilesAreCurrent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 6, loops 2 (3 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.
PiSessionCostScanner.rebuildDailyUsage (cognitive 18) Sources/CodexBarCore/PiSessionCostScanner.swift:1018— PiSessionCostScanner.rebuildDailyUsage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (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.
ProviderStatusFetcher.parseIncidentIOSummary (cognitive 18) Sources/CodexBarCore/ProviderStatusFetcher.swift:119— ProviderStatusFetcher.parseIncidentIOSummary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 2, 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.
Model.localizedZaiCountdown (cognitive 18) Sources/CodexBar/Menu/MenuCardView+ProviderDetailLocalization.swift:206— Model.localizedZaiCountdown has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 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.
SessionToolActivityParser.outcome (cognitive 18) Sources/CodexBarCore/SessionToolActivityParser.swift:74— SessionToolActivityParser.outcome has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (7 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
OpenAIDashboardBrowserCookieImporter.trySafari (cognitive 18) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:342— OpenAIDashboardBrowserCookieImporter.trySafari has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 5 (6 pts), loops 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. This shape REPEATS in the file: one other method here (OpenAIDashboardBrowserCookieImporter.tryBrowser) 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.
OpenAIDashboardBrowserCookieImporter.tryBrowser (cognitive 18) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:407— OpenAIDashboardBrowserCookieImporter.tryBrowser has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 5 (6 pts), loops 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. This shape REPEATS in the file: one other method here (OpenAIDashboardBrowserCookieImporter.trySafari) 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.
OpenAIDashboardBrowserCookieImporter.findFirstEmail (cognitive 18) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:724— OpenAIDashboardBrowserCookieImporter.findFirstEmail has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (4 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.
OpenAIDashboardFetcher.findFirstEmail (cognitive 18) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:749— OpenAIDashboardFetcher.findFirstEmail has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (4 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.
ProviderPluginHTTPResponse.fetch (cognitive 18) Sources/CodexBarCore/Plugins/ProviderPluginHTTPResponse.swift:112— ProviderPluginHTTPResponse.fetch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderPluginSnapshotMapper.mapResult (cognitive 18) Sources/CodexBarCore/Plugins/ProviderPluginResult.swift:87— ProviderPluginSnapshotMapper.mapResult has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (2 pts), 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.
BedrockUsageFetcher.parseGroupedResults (cognitive 18) Sources/CodexBarCore/Providers/Bedrock/BedrockUsageStats.swift:416— BedrockUsageFetcher.parseGroupedResults has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 6, loops 2 (3 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.
ClaudeAdminAPIUsageFetcher.makeSnapshot (cognitive 18) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageFetcher.swift:162— ClaudeAdminAPIUsageFetcher.makeSnapshot has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 3 (5 pts), boolean chains 1, ternaries 1 (nesting depth added 7). 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.
ClaudeStatusProbe.parse (cognitive 18) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:233— ClaudeStatusProbe.parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeStatusProbe.extractUsageError (cognitive 18) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:650— ClaudeStatusProbe.extractUsageError has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, ternaries 2 (4 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.
ClaudeStatusProbe.extractUsageErrorJSON (cognitive 18) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:1332— ClaudeStatusProbe.extractUsageErrorJSON has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, boolean chains 8, ternaries 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.
CursorStatusProbe.fetchCachedSession (cognitive 18) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe+SessionResolution.swift:347— CursorStatusProbe.fetchCachedSession has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CursorUsageEventsFetcher.fetchAllEvents (cognitive 18) Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:392— CursorUsageEventsFetcher.fetchAllEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 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.
DevinSessionImporter.findAccessToken (cognitive 18) Sources/CodexBarCore/Providers/Devin/DevinSessionImporter.swift:243— DevinSessionImporter.findAccessToken has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 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.
DevinUsageParser.findPlanName (cognitive 18) Sources/CodexBarCore/Providers/Devin/DevinUsageSnapshot.swift:247— DevinUsageParser.findPlanName has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 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.
FactoryCookieImporter.importSessions (cognitive 18) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:77— FactoryCookieImporter.importSessions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (8 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeminiStatusProbe.extractOAuthCredentialsFromBundle (cognitive 18) Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:672— GeminiStatusProbe.extractOAuthCredentialsFromBundle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MiMoCookieHeader.header (cognitive 18) Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:37— MiMoCookieHeader.header has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 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.
OpenCodeLegacyFallback.fetch (cognitive 18) Sources/CodexBarCore/Providers/Shared/OpenCodeLegacyFallback.swift:4— OpenCodeLegacyFallback.fetch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 6, error handling 2 (3 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.
TypeSafeWebFetchStrategy.fetch (cognitive 18) Sources/CodexBarCore/Providers/TypeSafe/TypeSafeWebFetchStrategy.swift:82— TypeSafeWebFetchStrategy.fetch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 2 (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.
WarpUsageSnapshot.toUsageSnapshot (cognitive 18) Sources/CodexBarCore/Providers/Warp/WarpUsageFetcher.swift:41— WarpUsageSnapshot.toUsageSnapshot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, ternaries 2 (4 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.
ClaudeWebAPIFetcher.fetchUsageSerialized (cognitive 18) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:1397— ClaudeWebAPIFetcher.fetchUsageSerialized has cognitive complexity 18 (threshold 15). Drivers by points: error handling 3 (5 pts), if/else 4 (5 pts), ternaries 1 (4 pts), match/switch 1 (3 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.
OneConsoleCookieHeaderBuilder.header (cognitive 18) Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieHeaders.swift:90— OneConsoleCookieHeaderBuilder.header has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 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.
Usage.laneSegments (cognitive 18) Integrations/Linux/Shared/Usage.js:314— Usage.laneSegments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7 (nesting depth added 3). Of this number, 12 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchUsage (cognitive 18) Sources/CodexBarCore/Resources/Plugins/tinyapi.js:8— fetchUsage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DockIconController.reevaluatePolicy (cognitive 17) Sources/CodexBar/DockIconController.swift:244— DockIconController.reevaluatePolicy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 1 (3 pts), boolean chains 1, match/switch 1, ternaries 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.
HTTPServerController.restart (cognitive 17) Sources/CodexBar/HTTPServerController.swift:85— HTTPServerController.restart has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistoricalUsageHistoryStore.reconstructWeekCurve (cognitive 17) Sources/CodexBar/HistoricalUsagePace.swift:455— HistoricalUsageHistoryStore.reconstructWeekCurve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CostHistoryChartMenuView.makeModel (cognitive 17) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:620— CostHistoryChartMenuView.makeModel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (5 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.
CreditsHistoryChartMenuView.makeModel (cognitive 17) Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:144— CreditsHistoryChartMenuView.makeModel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1, ternaries 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.
MenuDescriptor.actionsSection (cognitive 17) Sources/CodexBar/Menu/MenuDescriptor.swift:557— MenuDescriptor.actionsSection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, ternaries 1 (3 pts) (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.
SpendDashboardModel.hasRetainableUnpricedModelRows (cognitive 17) Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:206— SpendDashboardModel.hasRetainableUnpricedModelRows 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.
SpendDashboardModel.hasCompleteModelTokenCoverage (cognitive 17) Sources/CodexBar/SpendDashboard/SpendDashboardModel+ModelBreakdown.swift:317— SpendDashboardModel.hasCompleteModelTokenCoverage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatusItemController.addStackedCodexMenuCards (cognitive 17) Sources/CodexBar/StatusItem/StatusItemController+CodexStackedMenu.swift:5— StatusItemController.addStackedCodexMenuCards has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1, ternaries 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.
StatusItemController.addMenuCards (cognitive 17) Sources/CodexBar/StatusItem/StatusItemController+Menu.swift:688— StatusItemController.addMenuCards has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 1 (2 pts) (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.
StatusItemController.harvestRecyclableMenuCardViews (cognitive 17) Sources/CodexBar/StatusItem/StatusItemController+MenuCardRecycling.swift:14— StatusItemController.harvestRecyclableMenuCardViews has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.weeklyPace (cognitive 17) Sources/CodexBar/UsageStore/UsageStore+HistoricalPace.swift:8— UsageStore.weeklyPace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6 (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.
UsageStore.materializeCodexPlanUtilizationHistoryIfNeeded (cognitive 17) Sources/CodexBar/UsageStore/UsageStore+PlanUtilization.swift:1210— UsageStore.materializeCodexPlanUtilizationHistoryIfNeeded has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, loops 2 (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.
UsageStore.codexVisibleAccountMatchesCurrentProjection (cognitive 17) Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:453— UsageStore.codexVisibleAccountMatchesCurrentProjection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 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.
UsageStore.fetchTokenAccountOutcomes (cognitive 17) Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:686— UsageStore.fetchTokenAccountOutcomes has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), error handling 1 (4 pts), if/else 2 (4 pts) (nesting depth added 10). 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.
UsageStore.publishAvailableCodexCostCatchUpSnapshot (cognitive 17) Sources/CodexBar/Providers/Codex/UsageStore+CodexCostCatchUp.swift:237— UsageStore.publishAvailableCodexCostCatchUpSnapshot has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, ternaries 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.
UsageStore.codexAccountEmailForOpenAIDashboard (cognitive 17) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:1402— UsageStore.codexAccountEmailForOpenAIDashboard has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 6). 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.
UsageStore.checkSpendDashboardCodexCostCatchUpCompletion (cognitive 17) Sources/CodexBar/Providers/Codex/UsageStore+SpendDashboardCodexCostCatchUp.swift:292— UsageStore.checkSpendDashboardCodexCostCatchUpCompletion has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, 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.
CLICardsBriefRenderer.styledProviderCell (cognitive 17) Sources/CodexBarCLI/CLICardsBriefRenderer.swift:289— CLICardsBriefRenderer.styledProviderCell has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CLICardsBriefRenderer.dataRow (cognitive 17) Sources/CodexBarCLI/CLICardsBriefRenderer.swift:391— CLICardsBriefRenderer.dataRow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 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.
CookieHeaderCache.loadSerialized (cognitive 17) Sources/CodexBarCore/CookieHeaderCache.swift:415— CookieHeaderCache.loadSerialized has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CostUsageFetcher.tokenSnapshot (cognitive 17) Sources/CodexBarCore/CostUsageFetcher.swift:1804— CostUsageFetcher.tokenSnapshot has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CostUsageFetcher.codexBreakdownsWithProjectlessMetadata (cognitive 17) Sources/CodexBarCore/CostUsageFetcher+Projectless.swift:4— CostUsageFetcher.codexBreakdownsWithProjectlessMetadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, ternaries 1 (3 pts), loops 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.
CostUsageTokenSnapshot.projectQuotaWindow (cognitive 17) Sources/CodexBarCore/CostUsageModels+QuotaWindows.swift:487— CostUsageTokenSnapshot.projectQuotaWindow has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 6, if/else 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexLaunchPreflight.isLaunchCandidateAllowed (cognitive 17) Sources/CodexBarCore/PathEnvironment.swift:495— CodexLaunchPreflight.isLaunchCandidateAllowed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 1, ternaries 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.
ShellCommandLocator.parseAliasPath (cognitive 17) Sources/CodexBarCore/PathEnvironment.swift:1058— ShellCommandLocator.parseAliasPath 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.
ProviderStorageScanner.scan (cognitive 17) Sources/CodexBarCore/ProviderStorageFootprint.swift:375— ProviderStorageScanner.scan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Model.make (cognitive 17) Sources/CodexBar/Menu/MenuCardView.swift:889— Model.make has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 5, ternaries 3 (4 pts) (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.
UsageSnapshot.backfillingResetTimes (cognitive 17) Sources/CodexBarCore/UsageFetcher.swift:563— UsageSnapshot.backfillingResetTimes has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 11, if/else 6. Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (eligibleCachedReset). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
OpenAIDashboardFetcher.fetchWorkspaceRemainingBalanceIfNeeded (cognitive 17) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:931— OpenAIDashboardFetcher.fetchWorkspaceRemainingBalanceIfNeeded has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (8 pts), error handling 1 (nesting depth added 3). 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.
Request.init (cognitive 17) Sources/CodexBarCore/Plugins/ProviderPluginHTTPResponse.swift:23— Request.init has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (8 pts) (nesting depth added 2). 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.
ProviderPluginSnapshotMapper.costUsage (cognitive 17) Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:372— ProviderPluginSnapshotMapper.costUsage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 2 (3 pts) (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.
ProviderPluginApprovalBinding.init (cognitive 17) Sources/CodexBarCore/Plugins/UserProviderPlugins.swift:20— ProviderPluginApprovalBinding.init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AntigravityCLISession.reapRecordedSessionsIfNeeded (cognitive 17) Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:771— AntigravityCLISession.reapRecordedSessionsIfNeeded has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (7 pts), loops 1 (nesting depth added 3). 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.
AntigravityCLIHTTPSFetchStrategy.fetchWithReportFallback (cognitive 17) Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:561— AntigravityCLIHTTPSFetchStrategy.fetchWithReportFallback has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 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.
AntigravityStatusSnapshot.normalizeModel (cognitive 17) Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:528— AntigravityStatusSnapshot.normalizeModel has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (5 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 2). 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.
ClaudeCLISession.cleanup (cognitive 17) Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:559— ClaudeCLISession.cleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CodexDisplacedLivePreservationPlanner.makePlan (cognitive 17) Sources/CodexBarCore/Providers/Codex/CodexAccountPromotionPlanning.swift:43— CodexDisplacedLivePreservationPlanner.makePlan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, match/switch 1, ternaries 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.
DefaultCodexAccountReconciler.loadSnapshot (cognitive 17) Sources/CodexBarCore/Providers/Codex/CodexAccountReconciliation.swift:246— DefaultCodexAccountReconciler.loadSnapshot has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexStatusProbe.parseResetDate (cognitive 17) Sources/CodexBarCore/Providers/Codex/CodexStatusProbe.swift:172— CodexStatusProbe.parseResetDate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 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.
DevinUsageFetcher.fetch (cognitive 17) Sources/CodexBarCore/Providers/Devin/DevinUsageFetcher.swift:51— DevinUsageFetcher.fetch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (6 pts), boolean chains 4, error handling 2 (4 pts), loops 2 (3 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.
DevinUsageParser.findWindow (cognitive 17) Sources/CodexBarCore/Providers/Devin/DevinUsageSnapshot.swift:160— DevinUsageParser.findWindow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 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.
GeminiStatusProbe.findGeminiPackageRoot (cognitive 17) Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:590— GeminiStatusProbe.findGeminiPackageRoot has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KiloUsageFetcher.dictionaryContexts (cognitive 17) Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:945— KiloUsageFetcher.dictionaryContexts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 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.
KiroStatusProbe.fetch (cognitive 17) Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift:377— KiroStatusProbe.fetch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 4 (6 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.
KiroUsageLimitsAPI.parse (cognitive 17) Sources/CodexBarCore/Providers/Kiro/KiroUsageLimitsAPI.swift:210— KiroUsageLimitsAPI.parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, ternaries 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MiMoFirefoxSessionCookieImporter.hasDefaultOriginAttributes (cognitive 17) Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:525— MiMoFirefoxSessionCookieImporter.hasDefaultOriginAttributes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (2 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.
MiniMaxUsageFetcher.fetchBillingSummary (cognitive 17) Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:417— MiniMaxUsageFetcher.fetchBillingSummary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, 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.
MiniMaxUsageParser.parseMultiService (cognitive 17) Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:1223— MiniMaxUsageParser.parseMultiService has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MuseLocalUsageReader.accumulate (cognitive 17) Sources/CodexBarCore/Providers/Muse/MuseLocalUsageReader.swift:297— MuseLocalUsageReader.accumulate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 7, 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.
OpenCodeCookieImporter.importSession (cognitive 17) Sources/CodexBarCore/Providers/OpenCode/OpenCodeCookieImporter.swift:27— OpenCodeCookieImporter.importSession has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 2 (4 pts), error handling 1 (2 pts), boolean chains 1, 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.
OpenCodeGoLocalUsageReader.activeCredential (cognitive 17) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoLocalUsageReader.swift:682— OpenCodeGoLocalUsageReader.activeCredential has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), match/switch 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
QoderCookieRouting.curlRequestRoute (cognitive 17) Sources/CodexBarCore/Providers/Qoder/QoderCookieRouting.swift:128— QoderCookieRouting.curlRequestRoute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 1 (2 pts) (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.
VeniceCookieHeader.header (cognitive 17) Sources/CodexBarCore/Providers/Venice/VeniceCookieHeader.swift:34— VeniceCookieHeader.header 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.
ClaudeSubscriptionMetadata.parse (cognitive 17) Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeSubscriptionMetadata.swift:24— ClaudeSubscriptionMetadata.parse has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), ternaries 1 (nesting depth added 1). Of this number, 9 points are the body's own statements and 8 belong to one function item inside it that branches. 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.
CodexOAuthCredentialsStore.integerExpirationClaim (cognitive 17) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthCredentials.swift:530— CodexOAuthCredentialsStore.integerExpirationClaim has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AliyunOneConsoleChromiumCookieFallbackImporter.readCookies (cognitive 17) Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleChromiumCookieFallbackImporter.swift:82— AliyunOneConsoleChromiumCookieFallbackImporter.readCookies has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, 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.
Notifications.transition (cognitive 17) Integrations/Linux/Shared/Notifications.js:2— Notifications.transition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6 (nesting depth added 3). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 8, 10, 5). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AppDelegate.ensureSingleSettingsApplicationMenuItem (cognitive 16) Sources/CodexBar/CodexbarApp.swift:695— AppDelegate.ensureSingleSettingsApplicationMenuItem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, ternaries 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomebrewUpdateNotifier.postIfNeeded (cognitive 16) Sources/CodexBar/HomebrewUpdateNotifier.swift:48— HomebrewUpdateNotifier.postIfNeeded has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 6. 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.
ShareStatsSanitizer.safeLabel (cognitive 16) Sources/CodexBar/ShareStatsPayload.swift:184— ShareStatsSanitizer.safeLabel has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 3 (4 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ShareStatsFormatting.text (cognitive 16) Sources/CodexBar/ShareStatsPayload.swift:428— ShareStatsFormatting.text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3 (5 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MenuBarLayoutRenderer.resolvedDisplayToken (cognitive 16) Sources/CodexBar/Menu/MenuBarLayoutRenderer.swift:688— MenuBarLayoutRenderer.resolvedDisplayToken has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (4 pts), match/switch 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.
MenuBarPercentWindowPreference.applied (cognitive 16) Sources/CodexBar/Menu/MenuBarPercentWindowPreference.swift:177— MenuBarPercentWindowPreference.applied has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7 (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.
UsageMenuCardHeaderView.body (cognitive 16) Sources/CodexBar/Menu/MenuCardView.swift:355— UsageMenuCardHeaderView.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (7 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MenuDescriptor.appendProviderUsageSummaries (cognitive 16) Sources/CodexBar/Menu/MenuDescriptor.swift:377— MenuDescriptor.appendProviderUsageSummaries has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), loops 2 (5 pts), boolean chains 3, ternaries 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.
MenuDescriptor.hasAccount (cognitive 16) Sources/CodexBar/Menu/MenuDescriptor.swift:675— MenuDescriptor.hasAccount has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProviderSettingsOrganizationsRowView.body (cognitive 16) Sources/CodexBar/Settings/PreferencesProviderSettingsRows.swift:631— ProviderSettingsOrganizationsRowView.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 3 (6 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpendActivityWeekGrid.body (cognitive 16) Sources/CodexBar/SpendDashboard/SpendActivityHeatmap.swift:768— SpendActivityWeekGrid.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (6 pts), loops 2 (3 pts), match/switch 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.
SpendDashboardSource.snapshotRevision (cognitive 16) Sources/CodexBar/SpendDashboard/SpendDashboardController.swift:772— SpendDashboardSource.snapshotRevision has cognitive complexity 16 (threshold 15). Drivers by points: loops 8 (13 pts), if/else 2 (3 pts) (nesting depth added 6). 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.
SpendDashboardModel.hasCompleteTokenHistory (cognitive 16) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1027— SpendDashboardModel.hasCompleteTokenHistory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpendTrendChartModel.emptyStateTitle (cognitive 16) Sources/CodexBar/SpendDashboard/SpendTrendChartModel.swift:118— SpendTrendChartModel.emptyStateTitle has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 3, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
StatusItemController.updateVisibility (cognitive 16) Sources/CodexBar/StatusItem/StatusItemController.swift:772— StatusItemController.updateVisibility has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (4 pts), boolean chains 3 (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.
CloudSyncEngine.applyFetchedRecords (cognitive 16) Sources/CodexBar/Sync/CloudSyncEngine.swift:932— CloudSyncEngine.applyFetchedRecords has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.warningClaudeAccountDiscriminators (cognitive 16) Sources/CodexBar/PredictivePaceWarnings.swift:215— UsageStore.warningClaudeAccountDiscriminators has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 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.
UsageStore.applySelectedCodexVisibleAccountOutcome (cognitive 16) Sources/CodexBar/UsageStore/UsageStore+TokenAccounts.swift:1384— UsageStore.applySelectedCodexVisibleAccountOutcome has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageStore.loadTokenUsageSnapshot (cognitive 16) Sources/CodexBar/UsageStore/UsageStore+TokenCost.swift:144— UsageStore.loadTokenUsageSnapshot has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 5, ternaries 2. 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.
UsageStore.preservedClaudeWidgetUsage (cognitive 16) Sources/CodexBar/UsageStore/UsageStore+WidgetSnapshot.swift:376— UsageStore.preservedClaudeWidgetUsage has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 6, ternaries 3, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UsageStore.persistCodexWeeklyResetPublicationCandidate (cognitive 16) Sources/CodexBar/Providers/Codex/UsageStore+CodexWeeklyResetCandidatePersistence.swift:5— UsageStore.persistCodexWeeklyResetPublicationCandidate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, ternaries 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.
ClaudeSwapAccountSwitcherView.init (cognitive 16) Sources/CodexBar/Providers/Claude/ClaudeSwapAccountSwitcherView.swift:12— ClaudeSwapAccountSwitcherView.init has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (13 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.
CursorLoginRunner.deduplicatedCandidates (cognitive 16) Sources/CodexBar/Providers/Cursor/CursorLoginRunner.swift:371— CursorLoginRunner.deduplicatedCandidates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 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.
OpenAILiveUsageModel.refreshLimits (cognitive 16) Sources/CodexBar/Providers/OpenAI/OpenAILiveUsageModel.swift:203— OpenAILiveUsageModel.refreshLimits has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (7 pts), error handling 1 (nesting depth added 2). 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.
CLICardsRenderer.render (cognitive 16) Sources/CodexBarCLI/CLICardsRenderer.swift:250— CLICardsRenderer.render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 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.
CodexBarCLI.runConfigLogin (cognitive 16) Sources/CodexBarCLI/CLIConfigLoginCommand.swift:6— CodexBarCLI.runConfigLogin has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (6 pts), error handling 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ToonSerializer.needsQuoting (cognitive 16) Sources/CodexBarCLI/ToonFormatter.swift:430— ToonSerializer.needsQuoting has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (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.
CodexThreadMetadataReader.projectRoots (cognitive 16) Sources/CodexBarCore/CodexThreadMetadataReader+Projects.swift:50— CodexThreadMetadataReader.projectRoots has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CookieHeaderCache.commitRefreshReadSuppression (cognitive 16) Sources/CodexBarCore/CookieHeaderCache.swift:1060— CookieHeaderCache.commitRefreshReadSuppression has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeychainCacheStore.load (cognitive 16) Sources/CodexBarCore/KeychainCacheStore.swift:97— KeychainCacheStore.load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LocalAgentSessionScanner.scanWithActivity (cognitive 16) Sources/CodexBarCore/LocalAgentSessionScanner.swift:202— LocalAgentSessionScanner.scanWithActivity has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 6, if/else 2. 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.
ProviderEndpointOverrideValidator.isPrivateNetworkHost (cognitive 16) Sources/CodexBarCore/ProviderEndpointOverrideValidator.swift:150— ProviderEndpointOverrideValidator.isPrivateNetworkHost has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 4, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Model.usageItemDescriptors (cognitive 16) Sources/CodexBar/ProviderUsageItemVisibility.swift:103— Model.usageItemDescriptors has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Model.bedrockBillingDayKey (cognitive 16) Sources/CodexBar/Menu/MenuCardView+Costs.swift:427— Model.bedrockBillingDayKey has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Model.rateWindowLabels (cognitive 16) Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:571— Model.rateWindowLabels has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, ternaries 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.
SessionToolActivityStore.details (cognitive 16) Sources/CodexBarCore/SessionToolActivityStore.swift:36— SessionToolActivityStore.details has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 5, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SessionToolJSONProjection.consume (cognitive 16) Sources/CodexBarCore/SessionToolJSONProjection.swift:29— SessionToolJSONProjection.consume has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TextParsing.parseNumber (cognitive 16) Sources/CodexBarCore/TextParsing.swift:23— TextParsing.parseNumber has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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.
UsageFetcher.loadLatestCLIAccountSnapshot (cognitive 16) Sources/CodexBarCore/UsageFetcher.swift:1221— UsageFetcher.loadLatestCLIAccountSnapshot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, ternaries 1 (2 pts), error handling 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.
UsageFetcher.extractJSONObject (cognitive 16) Sources/CodexBarCore/UsageFetcher.swift:1522— UsageFetcher.extractJSONObject has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageFormatter.countdownDescription (cognitive 16) Sources/CodexBarCore/UsageFormatter.swift:118— UsageFormatter.countdownDescription has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (3 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.
OpenAIDashboardFetcher.fetchDashboardAPIResponse (cognitive 16) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher+SessionAuthorization.swift:29— OpenAIDashboardFetcher.fetchDashboardAPIResponse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpawnedProcessGroup.launchPTY (cognitive 16) Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:402— SpawnedProcessGroup.launchPTY has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 3, loops 3, error handling 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.
AntigravityLocalReader.embeddedTimestampsAgree (cognitive 16) Sources/CodexBarCore/Providers/Antigravity/AntigravityLocalSQLite.swift:474— AntigravityLocalReader.embeddedTimestampsAgree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 4, loops 2 (3 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.
AntigravityOAuthConfig.unambiguousClient (cognitive 16) Sources/CodexBarCore/Providers/Antigravity/AntigravityOAuthCredentialsStore.swift:280— AntigravityOAuthConfig.unambiguousClient has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 6). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (value). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AntigravityProtoReader.parseStepMetadata (cognitive 16) Sources/CodexBarCore/Providers/Antigravity/AntigravityProtoReader.swift:208— AntigravityProtoReader.parseStepMetadata has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (7 pts), if/else 2 (5 pts), match/switch 1 (2 pts), ternaries 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.
ClaudeConfigPaths.costProjectsRoots (cognitive 16) Sources/CodexBarCore/Providers/Claude/ClaudeConfigPaths.swift:20— ClaudeConfigPaths.costProjectsRoots has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, loops 2 (3 pts), 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.
ClaudeProviderDescriptor.resolveStrategies (cognitive 16) Sources/CodexBarCore/Providers/Claude/ClaudeProviderDescriptor.swift:292— ClaudeProviderDescriptor.resolveStrategies has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, 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.
CodexCLIBackendConfiguration.removingComment (cognitive 16) Sources/CodexBarCore/Providers/Codex/CodexCLIBackendConfiguration.swift:149— CodexCLIBackendConfiguration.removingComment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 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.
CodexCLISession.cleanup (cognitive 16) Sources/CodexBarCore/Providers/Codex/CodexCLISession.swift:300— CodexCLISession.cleanup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexStatusProbe.runAndParse (cognitive 16) Sources/CodexBarCore/Providers/Codex/CodexStatusProbe.swift:231— CodexStatusProbe.runAndParse has cognitive complexity 16 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 4 (8 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.
CursorAppAuthStore.loadSession (cognitive 16) Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift:249— CursorAppAuthStore.loadSession has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (5 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 3). 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.
CursorStatusProbe.fetchIfSessionAccepted (cognitive 16) Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:1151— CursorStatusProbe.fetchIfSessionAccepted has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 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.
GrokWebBillingFetcher.decodeProductUsage (cognitive 16) Sources/CodexBarCore/Providers/Grok/GrokWebBillingFetcher.swift:551— GrokWebBillingFetcher.decodeProductUsage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, match/switch 1 (2 pts), 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.
MiMoCookieImporter.recordsIncludingFirefoxSessionCookies (cognitive 16) Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift:222— MiMoCookieImporter.recordsIncludingFirefoxSessionCookies has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MiniMaxLocalStorageImporter.extractGroupID (cognitive 16) Sources/CodexBarCore/Providers/MiniMax/MiniMaxLocalStorageImporter.swift:462— MiniMaxLocalStorageImporter.extractGroupID has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MiniMaxUsageParser.resetDescription (cognitive 16) Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:1325— MiniMaxUsageParser.resetDescription has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 5 (6 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.
MistralSubscriptionBudgetParser.flightChunks (cognitive 16) Sources/CodexBarCore/Providers/Mistral/MistralSubscriptionBudgetParser.swift:58— MistralSubscriptionBudgetParser.flightChunks has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (6 pts), loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAIOrgRateLimitsFetcher.fetch (cognitive 16) Sources/CodexBarCore/Providers/OpenAI/OpenAIOrgRateLimitsFetcher.swift:31— OpenAIOrgRateLimitsFetcher.fetch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 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.
OpenCodeGoZenBalanceParser.findBalanceValue (cognitive 16) Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoZenBalanceParser.swift:70— OpenCodeGoZenBalanceParser.findBalanceValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 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.
ClaudeOAuthDelegatedRefreshCoordinator.waitForClaudeKeychainChange (cognitive 16) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift:421— ClaudeOAuthDelegatedRefreshCoordinator.waitForClaudeKeychainChange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 1 (2 pts), loops 1, match/switch 1 (nesting depth added 6). Of this number, 9 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HeroBlock.body (cognitive 16) Sources/CodexBarWidget/WidgetDesignSystem.swift:383— HeroBlock.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 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.
D4 · Code Duplication· Near-duplicate member family (7 members, 22 shared lines) · ×1
Near-duplicate member family (7 members, 22 shared lines) Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift:18— Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift:18-73 | Sources/CodexBarCore/Providers/JetBrains/JetBrainsProviderDescriptor.swift:6-50 | Sources/CodexBarCore/Providers/Kiro/KiroProviderDescriptor.swift:6-56 | Sources/CodexBarCore/Providers/LongCat/LongCatProviderDescriptor.swift:9-60 | Sources/CodexBarCore/Providers/Moonshot/MoonshotProviderDescriptor.swift:31-92 | Sources/CodexBarCore/Providers/Notion/NotionProviderDescriptor.swift:11-101 | Sources/CodexBarCore/Providers/Warp/WarpProviderDescriptor.swift:9-76 — These 7 members are variants of one another: a block of 22 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 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Near-duplicate member family (6 members, 20 shared lines) · ×1
Near-duplicate member family (6 members, 20 shared lines) Sources/CodexBarCore/Providers/CodeRabbit/CodeRabbitProviderDescriptor.swift:6— Sources/CodexBarCore/Providers/CodeRabbit/CodeRabbitProviderDescriptor.swift:6-46 | Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift:16-89 | Sources/CodexBarCore/Providers/Grok/GrokProviderDescriptor.swift:36-120 | Sources/CodexBarCore/Providers/Replicate/ReplicateProviderDescriptor.swift:13-64 | Sources/CodexBarCore/Providers/VertexAI/VertexAIProviderDescriptor.swift:6-52 | Sources/CodexBarCore/Providers/Windsurf/WindsurfProviderDescriptor.swift:6-66 — These 6 members are variants of one another: a block of 20 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 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.
Near-duplicate member pair (57 shared lines) Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:28— Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:28-124 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:45-171 — These two members are variants of one another: 57 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (50 shared lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:230— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:230-327 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:157-250 — These two members are variants of one another: 50 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:445— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:445-469 | Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1300-1307 | Sources/CodexBarCore/Providers/OpenCode/OpenCodeZenBillingParser.swift:117-126 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoZenBalanceParser.swift:142-151 | Sources/CodexBarCore/Providers/Shared/OpenCodeWebParsing.swift:206-215 | Sources/CodexBarCore/Providers/Shared/OpenCodeWebParsing.swift:217-226 | Sources/CodexBarCore/TextParsing.swift:61-67 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/CodexBarCore/CopilotUsageModels.swift:165— Sources/CodexBarCore/CopilotUsageModels.swift:165-179 | Sources/CodexBarCore/CopilotUsageModels.swift:202-216 | Sources/CodexBarCore/Providers/Codex/CodexSpendControlNumber.swift:5-19 | Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:201-223 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxDecoding.swift:21-36 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (100 corresponding lines) · ×1
Edited copy of a member (100 corresponding lines) Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:301— Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:301-400 | Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:402-510 — These two members are one piece of code written twice and then edited apart: 100 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:342— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:342-403 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:407-467 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (54 corresponding lines) · ×1
Edited copy of a member (54 corresponding lines) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1098— Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1098-1151 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1153-1209 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×1
Edited copy of a member (45 corresponding lines) Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1155— Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1155-1199 | Sources/CodexBar/SpendDashboard/SpendDashboardModel.swift:1579-1631 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:98— Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:98-145 | Sources/CodexBar/Menu/ProviderSwitcherButtons.swift:222-268 — 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 copy of a member (65 corresponding lines) · ×1
Edited copy of a member (65 corresponding lines) Sources/CodexBarCore/Providers/OpenCode/OpenCodeProviderDescriptor.swift:13— Sources/CodexBarCore/Providers/OpenCode/OpenCodeProviderDescriptor.swift:13-77 | Sources/CodexBarCore/Providers/StepFun/StepFunProviderDescriptor.swift:50-116 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (51 corresponding lines) · ×1
Edited copy of a member (51 corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:559— Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:559-617 | Sources/CodexBarCore/Providers/Codex/CodexCLISession.swift:300-350 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 31+ corresponding lines) · ×1
Edited copies of one member (3 members, 31+ corresponding lines) Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:491— Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:491-521 | Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:523-563 | Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift:565-605 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (48 corresponding lines) · ×1
Edited copy of a member (48 corresponding lines) Sources/CodexBarCore/Providers/Bedrock/BedrockProviderDescriptor.swift:24— Sources/CodexBarCore/Providers/Bedrock/BedrockProviderDescriptor.swift:24-74 | Sources/CodexBarCore/Providers/Pi/PiProviderDescriptor.swift:5-52 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (46 corresponding lines) · ×1
Edited copy of a member (46 corresponding lines) Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:184— Sources/CodexBarCore/Providers/OpenCode/OpenCodeUsageFetcher.swift:184-230 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift:330-375 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) Sources/CodexBar/SpendDashboard/SpendActivityHeatmap.swift:619— Sources/CodexBar/SpendDashboard/SpendActivityHeatmap.swift:619-652 | Sources/CodexBar/SpendDashboard/SpendActivityHeatmap.swift:831-860 — 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 (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:20— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:20-61 | Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:63-103 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 29+ corresponding lines) · ×1
Edited copies of one member (3 members, 29+ corresponding lines) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:741— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:741-769 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:779-810 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageFetcher.swift:827-858 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 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, 41+ corresponding lines) · ×1
Edited copies of one member (3 members, 41+ corresponding lines) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:540— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:540-580 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:582-624 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:713-763 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 41 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, 26+ corresponding lines) · ×1
Edited copies of one member (3 members, 26+ corresponding lines) Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:399— Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:399-424 | Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:468-494 | Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:496-522 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) Sources/CodexBar/Providers/OpenCode/OpenCodeProviderImplementation.swift:40— Sources/CodexBar/Providers/OpenCode/OpenCodeProviderImplementation.swift:40-67 | Sources/CodexBar/Providers/OpenCodeGo/OpenCodeGoProviderImplementation.swift:52-79 — 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 copies of one member (3 members, 14+ corresponding lines) · ×1
Edited copies of one member (3 members, 14+ corresponding lines) Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift:76— Sources/CodexBarCore/Providers/Cursor/CursorAppAuth.swift:76-93 | Sources/CodexBarCore/Providers/Factory/FactoryLocalStorageImporter.swift:244-258 | Sources/CodexBarCore/Providers/IBMBob/IBMBobUsageFetcher.swift:287-300 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 24+ corresponding lines) · ×1
Edited copies of one member (3 members, 24+ corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:105— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:105-131 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:173-197 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:94-117 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:349— Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:349-368 | Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:370-389 | Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:391-414 — 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 (6 members, 19+ corresponding lines) · ×1
Edited copies of one member (6 members, 19+ corresponding lines) Sources/CodexBar/Providers/Abacus/AbacusProviderImplementation.swift:21— Sources/CodexBar/Providers/Abacus/AbacusProviderImplementation.swift:21-39 | Sources/CodexBar/Providers/Augment/AugmentProviderImplementation.swift:25-43 | Sources/CodexBar/Providers/Cursor/CursorProviderImplementation.swift:28-46 | Sources/CodexBar/Providers/MiMo/MiMoProviderImplementation.swift:14-32 | Sources/CodexBar/Providers/Mistral/MistralProviderImplementation.swift:26-44 | Sources/CodexBar/Providers/QwenCloud/QwenCloudProviderImplementation.swift:14-32 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 18+ corresponding lines) · ×1
Edited copies of one member (5 members, 18+ corresponding lines) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:839— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift:839-859 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxSubscriptionMetadata.swift:186-203 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift:997-1018 | Sources/CodexBarCore/Providers/OpenCode/OpenCodeZenBillingParser.swift:77-95 | TestsPlugin/T3ChatReference.swift:146-171 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 11+ corresponding lines) · ×1
Edited copies of one member (6 members, 11+ corresponding lines) Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:519— Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:519-529 | Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:536-546 | Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:553-563 | Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:575-585 | Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:587-597 | Sources/CodexBar/Providers/Codex/CodexSettingsStore.swift:604-614 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 8+ corresponding lines) · ×1
Edited copies of one member (5 members, 8+ corresponding lines) Sources/CodexBarCore/CookieHeaderCache.swift:277— Sources/CodexBarCore/CookieHeaderCache.swift:277-289 | Sources/CodexBarCore/CookieHeaderCache.swift:291-305 | Sources/CodexBarCore/CookieHeaderCache.swift:307-314 | Sources/CodexBarCore/CookieHeaderCache.swift:950-964 | Sources/CodexBarCore/CookieHeaderCache.swift:966-973 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 10+ corresponding lines) · ×1
Edited copies of one member (5 members, 10+ corresponding lines) Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:246— Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:246-255 | Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:626-635 | Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:668-677 | Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:679-688 | Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:702-711 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 6+ corresponding lines) · ×1
Edited copies of one member (4 members, 6+ corresponding lines) Sources/CodexBar/Settings/PreferencesProvidersPane.swift:385— Sources/CodexBar/Settings/PreferencesProvidersPane.swift:385-390 | Sources/CodexBar/Settings/PreferencesProvidersPane.swift:392-399 | Sources/CodexBar/Settings/PreferencesProvidersPane.swift:401-406 | Sources/CodexBar/Settings/PreferencesProvidersPane.swift:418-423 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 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 (8 members, 11+ corresponding lines) · ×1
Edited copies of one member (8 members, 11+ corresponding lines) Sources/CodexBarWidget/CodexBarAccountUsageWidget.swift:9— Sources/CodexBarWidget/CodexBarAccountUsageWidget.swift:9-20 | Sources/CodexBarWidget/CodexBarAccountUsageWidget.swift:191-202 | Sources/CodexBarWidget/CodexBarWidgetBundle.swift:21-31 | Sources/CodexBarWidget/CodexBarWidgetBundle.swift:37-48 | Sources/CodexBarWidget/CodexBarWidgetBundle.swift:54-65 | Sources/CodexBarWidget/CodexBarWidgetBundle.swift:71-82 | Sources/CodexBarWidget/CodexBarWidgetBundle.swift:92-104 | Sources/CodexBarWidget/CodexBarWidgetBundle.swift:110-122 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 7+ corresponding lines) · ×1
Edited copies of one member (8 members, 7+ corresponding lines) Sources/CodexBarCore/Providers/AzureOpenAI/AzureOpenAISettingsReader.swift:37— Sources/CodexBarCore/Providers/AzureOpenAI/AzureOpenAISettingsReader.swift:37-44 | Sources/CodexBarCore/Providers/Chutes/ChutesSettingsReader.swift:22-28 | Sources/CodexBarCore/Providers/Codebuff/CodebuffSettingsReader.swift:22-28 | Sources/CodexBarCore/Providers/ElevenLabs/ElevenLabsSettingsReader.swift:26-32 | Sources/CodexBarCore/Providers/Groq/GroqSettingsReader.swift:22-28 | Sources/CodexBarCore/Providers/MiMo/MiMoUsageFetcher.swift:60-66 | Sources/CodexBarCore/Providers/NeuralWatt/NeuralWattSettingsReader.swift:25-31 | Sources/CodexBarCore/Providers/OpenRouter/OpenRouterSettingsReader.swift:35-41 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 4+ corresponding lines) · ×1
Edited copies of one member (8 members, 4+ corresponding lines) Sources/CodexBarCore/Providers/Abacus/AbacusCookieImporter.swift:109— Sources/CodexBarCore/Providers/Abacus/AbacusCookieImporter.swift:109-112 | Sources/CodexBarCore/Providers/CommandCode/CommandCodeCookieImporter.swift:95-98 | Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:114-117 | Sources/CodexBarCore/Providers/Groq/GroqConsoleSession.swift:169-172 | Sources/CodexBarCore/Providers/Kimi/KimiCookieImporter.swift:140-143 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxCookieImporter.swift:117-120 | Sources/CodexBarCore/Providers/Perplexity/PerplexityCookieImporter.swift:136-139 | Sources/CodexBarCore/Providers/Venice/VeniceCookieImporter.swift:68-71 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×1
Edited copies of one member (4 members, 8+ corresponding lines) Sources/CodexBarCore/Providers/Claude/ClaudeCLIAuthStatusProbe.swift:17— Sources/CodexBarCore/Providers/Claude/ClaudeCLIAuthStatusProbe.swift:17-24 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials+TestingOverrides.swift:320-327 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift:690-697 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthKeychainAccessGate.swift:119-126 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 5+ corresponding lines) · ×1
Edited copies of one member (4 members, 5+ corresponding lines) Sources/CodexBar/Settings/SettingsStore+ConfigPersistence.swift:221— Sources/CodexBar/Settings/SettingsStore+ConfigPersistence.swift:221-225 | Sources/CodexBarCore/Providers/Kilo/KiloUsageFetcher.swift:154-158 | Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleJSON.swift:194-198 | Sources/CodexBarCore/Providers/Venice/VeniceWebUsageFetcher.swift:214-218 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 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 (6 members, 4+ corresponding lines) · ×1
Edited copies of one member (6 members, 4+ corresponding lines) Sources/CodexBar/Providers/Codex/CodexAccountUsageSnapshotStore.swift:159— Sources/CodexBar/Providers/Codex/CodexAccountUsageSnapshotStore.swift:159-162 | Sources/CodexBarCore/Config/CodexBarConfigStore.swift:34-37 | Sources/CodexBarCore/ManagedCodexAccountStore.swift:45-48 | Sources/CodexBarCore/Providers/Antigravity/AntigravityOAuthCredentialsStore.swift:421-424 | Sources/CodexBarCore/Providers/Codex/CodexOpenAIWorkspaceIdentityCache.swift:26-29 | Sources/CodexBarCore/TokenAccounts.swift:189-192 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 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 6 times and the copies will drift further apart.
Duplicated block (62 lines × 2) Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:332— Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:332-393 | Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:440-501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:394` calls `closeFile` and `Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:502` 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 (42 lines × 2) Sources/CodexBarCLI/CLIHelp.swift:77— Sources/CodexBarCLI/CLIHelp.swift:77-118 | Sources/CodexBarCLI/CLIHelp.swift:127-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (32–33 lines × 2) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:364— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:364-396 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:429-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 `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:364` 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 (31 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:31— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:31-61 | Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:73-103 — 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 `Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:31` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageSnapshot.swift:18— Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageSnapshot.swift:18-46 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudUsageSnapshot.swift:18-46 — before extracting anything, compare `Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageSnapshot.swift` and `Sources/CodexBarCore/Providers/QwenCloud/QwenCloudUsageSnapshot.swift` as WHOLE FILES: 86% 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.
Duplicated block (26 lines × 3) Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:679— Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:679-704 | Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:730-755 | Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:793-818 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/Providers/Codex/UsageStore+OpenAIWeb.swift:679` 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 (23–25 lines × 2) Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:235— Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:235-257 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:363-387 — before extracting anything, compare `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift` and `Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 172 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 (20–25 lines × 2) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:725— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:725-744 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:750-774 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (22–24 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:407— Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:407-430 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:821-842 — 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 `Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:407` 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 (24 lines × 2) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1290— Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1290-1313 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1360-1383 — 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 `Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1290` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (19–20 lines × 2) Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:203— Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:203-221 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:335-354 — before extracting anything, compare `Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift` and `Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 172 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 (18–19 lines × 2) Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:1083— Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:1083-1101 | Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:647-664 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:1083` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.swift:665` calls `ioFailed`, `usleep` and `Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:1102` 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 (18 lines × 3) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:216— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:216-233 | Sources/CodexBar/Menu/CreditsHistoryChartMenuView.swift:76-93 | Sources/CodexBar/Menu/UsageBreakdownChartMenuView.swift:113-130 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:216` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) Sources/CodexBarCLI/CLIGuardCommand.swift:258— Sources/CodexBarCLI/CLIGuardCommand.swift:258-274 | Sources/CodexBarCLI/CLIHooksWatchCommand.swift:160-177 — 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 `Sources/CodexBarCLI/CLIGuardCommand.swift:258` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15–16 lines × 4) Sources/CodexBar/IconRenderer.swift:388— Sources/CodexBar/IconRenderer.swift:388-402 | Sources/CodexBar/IconRenderer.swift:477-491 | Sources/CodexBar/IconRenderer.swift:527-542 | Sources/CodexBar/IconRenderer.swift:597-611 — 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. 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–16 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:169— Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift:169-182 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift:179-194 — before extracting anything, compare `Sources/CodexBarCore/Providers/Claude/ClaudeAdminAPIUsageSnapshot.swift` and `Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIUsageSnapshot.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (14–15 lines × 3) Sources/CodexBarCore/CookieHeaderCache.swift:876— Sources/CodexBarCore/CookieHeaderCache.swift:876-889 | Sources/CodexBarCore/Providers/Antigravity/AntigravityCLISession.swift:1267-1281 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthPendingCacheClearStore.swift:396-410 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/CookieHeaderCache.swift:876` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (13–15 lines × 2) Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:150— Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:150-164 | Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:187-199 — 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 `Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:150` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:165` calls `storeSnapshot` and `Sources/CodexBarCore/CodexWorkspaceUsageSidecar.swift:200` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–15 lines × 2) Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:615— Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:615-629 | Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:631-641 — 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 `Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:615` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:630` calls `appendingPathComponent` and `Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:614` 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 × 4) Sources/CodexBarCore/Providers/Claude/ClaudeScopedWeeklyLimitMapper.swift:49— Sources/CodexBarCore/Providers/Claude/ClaudeScopedWeeklyLimitMapper.swift:49-62 | Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift:540-553 | Sources/CodexBarCore/Providers/Codex/CodexAdditionalRateLimitMapper.swift:139-152 | Sources/CodexBarCore/Providers/Copilot/CopilotBudgetWebFetcher.swift:743-756 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (14 lines × 3) Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:564— Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:564-577 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:607-620 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:740-753 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/DeepSeek/DeepSeekUsageCostParser.swift:564` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 8) Sources/CodexBarCore/Providers/Bedrock/BedrockProviderDescriptor.swift:32— Sources/CodexBarCore/Providers/Bedrock/BedrockProviderDescriptor.swift:32-44 | Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift:24-36 | Sources/CodexBarCore/Providers/Grok/GrokProviderDescriptor.swift:60-72 | Sources/CodexBarCore/Providers/Groq/GroqProviderDescriptor.swift:23-35 | Sources/CodexBarCore/Providers/JetBrains/JetBrainsProviderDescriptor.swift:16-28 | Sources/CodexBarCore/Providers/Kiro/KiroProviderDescriptor.swift:12-24 | Sources/CodexBarCore/Providers/StepFun/StepFunProviderDescriptor.swift:73-85 | Sources/CodexBarCore/Providers/VertexAI/VertexAIProviderDescriptor.swift:13-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times.
Duplicated block (12–13 lines × 7) Sources/CodexBarCore/PathEnvironment.swift:63— Sources/CodexBarCore/PathEnvironment.swift:63-75 | Sources/CodexBarCore/PathEnvironment.swift:85-96 | Sources/CodexBarCore/PathEnvironment.swift:228-240 | Sources/CodexBarCore/PathEnvironment.swift:250-262 | Sources/CodexBarCore/PathEnvironment.swift:293-304 | Sources/CodexBarCore/PathEnvironment.swift:324-335 | Sources/CodexBarCore/PathEnvironment.swift:344-355 — all 7 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 `Sources/CodexBarCore/PathEnvironment.swift:63` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodexBarCore/PathEnvironment.swift:76` calls `claudeWellKnownPaths` and `Sources/CodexBarCore/PathEnvironment.swift:336` 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 (12–13 lines × 2) Sources/CodexBar/StatusItem/StatusItemController+MenuPresentation.swift:74— Sources/CodexBar/StatusItem/StatusItemController+MenuPresentation.swift:74-85 | Sources/CodexBar/StatusItem/StatusItemController+MenuTextRows.swift:25-37 — 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 `Sources/CodexBar/StatusItem/StatusItemController+MenuPresentation.swift:74` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `Sources/CodexBar/StatusItem/StatusItemController+MenuTextRows.swift:24` calls `setContentCompressionResistancePriority` and `Sources/CodexBar/StatusItem/StatusItemController+MenuPresentation.swift:73` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 19) Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift:27— Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift:27-38 | Sources/CodexBarCore/Providers/AzureOpenAI/AzureOpenAIProviderDescriptor.swift:26-37 | Sources/CodexBarCore/Providers/Bedrock/BedrockProviderDescriptor.swift:32-43 | Sources/CodexBarCore/Providers/CodeRabbit/CodeRabbitProviderDescriptor.swift:13-24 | Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift:24-35 | Sources/CodexBarCore/Providers/Grok/GrokProviderDescriptor.swift:60-71 | Sources/CodexBarCore/Providers/Groq/GroqProviderDescriptor.swift:23-34 | Sources/CodexBarCore/Providers/JetBrains/JetBrainsProviderDescriptor.swift:16-27 | Sources/CodexBarCore/Providers/Kiro/KiroProviderDescriptor.swift:12-23 | Sources/CodexBarCore/Providers/LongCat/LongCatProviderDescriptor.swift:17-28 | Sources/CodexBarCore/Providers/Moonshot/MoonshotProviderDescriptor.swift:44-55 | Sources/CodexBarCore/Providers/Notion/NotionProviderDescriptor.swift:31-43 | Sources/CodexBarCore/Providers/Ollama/OllamaProviderDescriptor.swift:27-38 | Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIProviderDescriptor.swift:31-42 | Sources/CodexBarCore/Providers/Replicate/ReplicateProviderDescriptor.swift:22-33 | Sources/CodexBarCore/Providers/StepFun/StepFunProviderDescriptor.swift:73-84 | Sources/CodexBarCore/Providers/VertexAI/VertexAIProviderDescriptor.swift:13-24 | Sources/CodexBarCore/Providers/Warp/WarpProviderDescriptor.swift:16-27 | Sources/CodexBarCore/Providers/Windsurf/WindsurfProviderDescriptor.swift:28-39 — before extracting anything, compare `Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift` and `Sources/CodexBarCore/Providers/JetBrains/JetBrainsProviderDescriptor.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodexBarCore/Providers/Ollama/OllamaProviderDescriptor.swift:39` calls `ProviderDebugPaneCapabilities` and `Sources/CodexBarCore/Providers/Replicate/ReplicateProviderDescriptor.swift:34` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 9) Sources/CodexBarCore/Providers/Copilot/CopilotProviderDescriptor.swift:30— Sources/CodexBarCore/Providers/Copilot/CopilotProviderDescriptor.swift:30-41 | Sources/CodexBarCore/Providers/Devin/DevinProviderDescriptor.swift:31-42 | Sources/CodexBarCore/Providers/Kilo/KiloProviderDescriptor.swift:35-46 | Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift:71-82 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxProviderDescriptor.swift:61-72 | Sources/CodexBarCore/Providers/Mistral/MistralProviderDescriptor.swift:21-32 | Sources/CodexBarCore/Providers/OpenCode/OpenCodeProviderDescriptor.swift:34-45 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:16-27 | Sources/CodexBarCore/Providers/Zai/ZaiProviderDescriptor.swift:68-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 9 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 9 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodexBarCore/Providers/Copilot/CopilotProviderDescriptor.swift:27` calls `ProviderConfigCapabilities` and `Sources/CodexBarCore/Providers/Kilo/KiloProviderDescriptor.swift:32` 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–12 lines × 5) Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:36— Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:36-44 | Sources/CodexBarCore/Providers/Copilot/CopilotProviderDescriptor.swift:56-65 | Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift:90-99 | Sources/CodexBarCore/Providers/Notion/NotionProviderDescriptor.swift:54-65 | Sources/CodexBarCore/Providers/OpenCode/OpenCodeProviderDescriptor.swift:53-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:36` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 4) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:35— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:35-46 | Sources/CodexBarCore/Providers/Cursor/CursorProviderDescriptor.swift:39-50 | Sources/CodexBarCore/Providers/Gemini/GeminiProviderDescriptor.swift:14-25 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift:53-64 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift:50` calls `ProviderConfigCapabilities` and `Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:32` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–12 lines × 3) Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:1026— Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:1026-1037 | Sources/CodexBarCore/CostUsageModels.swift:1266-1277 | Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:830-840 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/Menu/CostHistoryChartMenuView.swift:1026` 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 (12 lines × 3) Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:852— Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:852-863 | Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:933-944 | Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:1026-1037 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:852` 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–12 lines × 2) Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:657— Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:657-667 | Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:763-774 — 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 `Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:657` 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–11 lines × 9) Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift:47— Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift:47-57 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekProviderDescriptor.swift:97-107 | Sources/CodexBarCore/Providers/Devin/DevinProviderDescriptor.swift:56-66 | Sources/CodexBarCore/Providers/JetBrains/JetBrainsProviderDescriptor.swift:33-42 | Sources/CodexBarCore/Providers/Kilo/KiloProviderDescriptor.swift:54-64 | Sources/CodexBarCore/Providers/LongCat/LongCatProviderDescriptor.swift:35-45 | Sources/CodexBarCore/Providers/Moonshot/MoonshotProviderDescriptor.swift:63-73 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:35-45 | Sources/CodexBarCore/Providers/Warp/WarpProviderDescriptor.swift:34-44 — before extracting anything, compare `Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift` and `Sources/CodexBarCore/Providers/JetBrains/JetBrainsProviderDescriptor.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift:47` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–11 lines × 9) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:40— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:40-47 | Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift:51-60 | Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:32-40 | Sources/CodexBarCore/Providers/Copilot/CopilotProviderDescriptor.swift:35-45 | Sources/CodexBarCore/Providers/Cursor/CursorProviderDescriptor.swift:44-52 | Sources/CodexBarCore/Providers/Devin/DevinProviderDescriptor.swift:36-46 | Sources/CodexBarCore/Providers/Gemini/GeminiProviderDescriptor.swift:19-26 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxProviderDescriptor.swift:66-73 | Sources/CodexBarCore/Providers/Zai/ZaiProviderDescriptor.swift:73-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 9 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 9 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift:40` 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 × 4) Sources/CodexBarCore/CostUsageFetcher.swift:209— Sources/CodexBarCore/CostUsageFetcher.swift:209-219 | Sources/CodexBarCore/CostUsageFetcher.swift:247-257 | Sources/CodexBarCore/CostUsageFetcher.swift:450-460 | Sources/CodexBarCore/CostUsageFetcher.swift:495-505 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–11 lines × 3) Sources/CodexBar/Providers/Codex/CodexLoginAlertPresentation.swift:37— Sources/CodexBar/Providers/Codex/CodexLoginAlertPresentation.swift:37-43 | Sources/CodexBar/Providers/Kiro/KiroLoginAlertPresentation.swift:26-36 | Sources/CodexBar/StatusItem/StatusItemController+Actions.swift:923-933 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. 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–11 lines × 2) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:955— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:955-962 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1010-1020 — 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 `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:955` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–11 lines × 2) Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:287— Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:287-297 | Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:307-315 — 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 `Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 17) Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift:47— Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift:47-56 | Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:35-44 | Sources/CodexBarCore/Providers/Augment/AugmentProviderDescriptor.swift:43-52 | Sources/CodexBarCore/Providers/Codebuff/CodebuffProviderDescriptor.swift:50-59 | Sources/CodexBarCore/Providers/Copilot/CopilotProviderDescriptor.swift:55-64 | Sources/CodexBarCore/Providers/DeepSeek/DeepSeekProviderDescriptor.swift:97-106 | Sources/CodexBarCore/Providers/Devin/DevinProviderDescriptor.swift:56-65 | Sources/CodexBarCore/Providers/JetBrains/JetBrainsProviderDescriptor.swift:33-42 | Sources/CodexBarCore/Providers/Kilo/KiloProviderDescriptor.swift:54-63 | Sources/CodexBarCore/Providers/Kimi/KimiProviderDescriptor.swift:89-98 | Sources/CodexBarCore/Providers/Kiro/KiroProviderDescriptor.swift:30-39 | Sources/CodexBarCore/Providers/LongCat/LongCatProviderDescriptor.swift:35-44 | Sources/CodexBarCore/Providers/Moonshot/MoonshotProviderDescriptor.swift:63-72 | Sources/CodexBarCore/Providers/Notion/NotionProviderDescriptor.swift:51-62 | Sources/CodexBarCore/Providers/OpenCode/OpenCodeProviderDescriptor.swift:52-61 | Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:35-44 | Sources/CodexBarCore/Providers/Warp/WarpProviderDescriptor.swift:34-43 — before extracting anything, compare `Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift` and `Sources/CodexBarCore/Providers/JetBrains/JetBrainsProviderDescriptor.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `Sources/CodexBarCore/Providers/Abacus/AbacusProviderDescriptor.swift:47` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift:45` calls `ProviderPaceCapability`, `hasPrefix` and `Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:45` 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 (1–10 lines × 5) Sources/CodexBarCore/Config/SettingsValue.swift:10— Sources/CodexBarCore/Config/SettingsValue.swift:10-19 | Sources/CodexBarCore/Providers/HuggingFace/HuggingFaceSettingsReader.swift:66-75 | Sources/CodexBarCore/Providers/IBMBob/IBMBobSettingsReader.swift:13-22 | Sources/CodexBarCore/Providers/Nous/NousSettingsReader.swift:278-279 | Sources/CodexBarCore/Providers/Nous/NousSettingsReader.swift:280-280 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Config/SettingsValue.swift:10` 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. 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 (6–10 lines × 2) Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:1157— Sources/CodexBarCore/CodexLocalProjectUsageIndexer.swift:1157-1166 | Sources/CodexBarCore/CodexLocalProjectUsageProjection.swift:36-41 — 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 (9 lines × 9) Sources/CodexBarCore/Providers/CodeRabbit/CodeRabbitProviderDescriptor.swift:31— Sources/CodexBarCore/Providers/CodeRabbit/CodeRabbitProviderDescriptor.swift:31-39 | Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift:44-52 | Sources/CodexBarCore/Providers/IBMBob/IBMBobProviderDescriptor.swift:43-51 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxProviderDescriptor.swift:86-94 | Sources/CodexBarCore/Providers/Replicate/ReplicateProviderDescriptor.swift:40-48 | Sources/CodexBarCore/Providers/Wayfinder/WayfinderProviderDescriptor.swift:35-43 | Sources/CodexBarCore/Providers/Windsurf/WindsurfProviderDescriptor.swift:49-57 | Sources/CodexBarCore/Providers/Zai/ZaiProviderDescriptor.swift:86-94 | Sources/CodexBarCore/Providers/ZoomMate/ZoomMateProviderDescriptor.swift:46-54 — before extracting anything, compare `Sources/CodexBarCore/Providers/CodeRabbit/CodeRabbitProviderDescriptor.swift` and `Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `Sources/CodexBarCore/Providers/CodeRabbit/CodeRabbitProviderDescriptor.swift:31` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8–9 lines × 5) Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:52— Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:52-59 | Sources/CodexBarCore/Providers/Grok/GrokProviderDescriptor.swift:81-89 | Sources/CodexBarCore/Providers/Muse/MuseProviderDescriptor.swift:57-64 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift:71-79 | Sources/CodexBarCore/Providers/VertexAI/VertexAIProviderDescriptor.swift:32-39 — before extracting anything, compare `Sources/CodexBarCore/Providers/Grok/GrokProviderDescriptor.swift` and `Sources/CodexBarCore/Providers/VertexAI/VertexAIProviderDescriptor.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:52` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 4) Sources/CodexBarCore/Providers/AzureOpenAI/AzureOpenAIProviderDescriptor.swift:47— Sources/CodexBarCore/Providers/AzureOpenAI/AzureOpenAIProviderDescriptor.swift:47-54 | Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift:45-53 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxProviderDescriptor.swift:87-95 | Sources/CodexBarCore/Providers/Replicate/ReplicateProviderDescriptor.swift:41-49 — before extracting anything, compare `Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift` and `Sources/CodexBarCore/Providers/Replicate/ReplicateProviderDescriptor.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `Sources/CodexBarCore/Providers/AzureOpenAI/AzureOpenAIProviderDescriptor.swift:47` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 3) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1058— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1058-1067 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1101-1110 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1126-1135 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1058` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1111` calls `setValue` and `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:1068` 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–9 lines × 2) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:123— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:123-131 | Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:286-293 — 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 `Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardBrowserCookieImporter.swift:123` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 14) Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:51— Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:51-58 | Sources/CodexBarCore/Providers/CodeRabbit/CodeRabbitProviderDescriptor.swift:30-37 | Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift:43-50 | Sources/CodexBarCore/Providers/Grok/GrokProviderDescriptor.swift:80-87 | Sources/CodexBarCore/Providers/IBMBob/IBMBobProviderDescriptor.swift:42-49 | Sources/CodexBarCore/Providers/MiniMax/MiniMaxProviderDescriptor.swift:85-92 | Sources/CodexBarCore/Providers/Muse/MuseProviderDescriptor.swift:56-63 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift:70-77 | Sources/CodexBarCore/Providers/Replicate/ReplicateProviderDescriptor.swift:39-46 | Sources/CodexBarCore/Providers/VertexAI/VertexAIProviderDescriptor.swift:31-38 | Sources/CodexBarCore/Providers/Wayfinder/WayfinderProviderDescriptor.swift:34-41 | Sources/CodexBarCore/Providers/Windsurf/WindsurfProviderDescriptor.swift:48-55 | Sources/CodexBarCore/Providers/Zai/ZaiProviderDescriptor.swift:85-92 | Sources/CodexBarCore/Providers/ZoomMate/ZoomMateProviderDescriptor.swift:42-52 — before extracting anything, compare `Sources/CodexBarCore/Providers/CodeRabbit/CodeRabbitProviderDescriptor.swift` and `Sources/CodexBarCore/Providers/Factory/FactoryProviderDescriptor.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:51` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 5) Sources/CodexBar/Settings/PreferencesDebugPane.swift:159— Sources/CodexBar/Settings/PreferencesDebugPane.swift:159-166 | Sources/CodexBar/Settings/PreferencesDebugPane.swift:191-198 | Sources/CodexBar/Settings/PreferencesDebugPane.swift:220-227 | Sources/CodexBar/Settings/PreferencesDebugPane.swift:393-400 | Sources/CodexBar/Settings/PreferencesDebugPane.swift:409-416 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/Settings/PreferencesDebugPane.swift:159` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `alignment` to `.topLeading` in one and `.leading` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7–8 lines × 3) Sources/CodexBarCore/PiFamilySessionScanner.swift:969— Sources/CodexBarCore/PiFamilySessionScanner.swift:969-976 | Sources/CodexBarCore/PiFamilySessionScanner.swift:979-986 | Sources/CodexBarCore/PiFamilySessionScanner.swift:987-993 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/PiFamilySessionScanner.swift:969` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodexBarCore/PiFamilySessionScanner.swift:978` calls `pathURL`, `SessionRootResolution` and `Sources/CodexBarCore/PiFamilySessionScanner.swift:987` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–8 lines × 2) Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:720— Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:720-726 | Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:2214-2221 — 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 `Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift:720` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–8 lines × 2) Sources/CodexBarCore/Providers/Grok/GrokRPCClient.swift:38— Sources/CodexBarCore/Providers/Grok/GrokRPCClient.swift:38-43 | Sources/CodexBarCore/UsageFetcher.swift:1035-1042 — 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 `Sources/CodexBarCore/UsageFetcher.swift:1035` 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 (3–7 lines × 3) Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1130— Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1130-1132 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1138-1144 | Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1196-1202 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe.swift:1138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–6 lines × 3) Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:410— Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:410-412 | Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:480-485 | Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:512-517 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBar/StatusItem/StatusItemController+Animation.swift:410` 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.
Duplicated block (3–5 lines × 4) Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:45— Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:45-49 | Sources/CodexBarCore/Providers/Mistral/MistralCookieImporter.swift:52-54 | Sources/CodexBarCore/Providers/Replicate/ReplicateCookieImporter.swift:26-30 | Sources/CodexBarCore/Providers/Venice/VeniceCookieImporter.swift:22-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/Grok/GrokCookieImporter.swift:45` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (2–5 lines × 7) Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:453— Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardParser.swift:453-455 | Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:1303-1304 | Sources/CodexBarCore/Providers/OpenCode/OpenCodeZenBillingParser.swift:119-122 | Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoZenBalanceParser.swift:145-149 | Sources/CodexBarCore/Providers/Shared/OpenCodeWebParsing.swift:209-213 | Sources/CodexBarCore/Providers/Shared/OpenCodeWebParsing.swift:219-222 | Sources/CodexBarCore/TextParsing.swift:63-64 — there are 7 copies across 6 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 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/OpenCode/OpenCodeZenBillingParser.swift:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoZenBalanceParser.swift:145` calls `firstMatch` and `Sources/CodexBarCore/Providers/OpenCode/OpenCodeZenBillingParser.swift:119` 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 (15 lines × 3) Sources/CodexBarCore/Providers/Bifrost/BifrostSettingsReader.swift:7— Sources/CodexBarCore/Providers/Bifrost/BifrostSettingsReader.swift:7-21 | Sources/CodexBarCore/Providers/LLMProxy/LLMProxySettingsReader.swift:7-33 | Sources/CodexBarCore/Providers/LiteLLM/LiteLLMSettingsReader.swift:8-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodexBarCore/Providers/LLMProxy/LLMProxySettingsReader.swift:7` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodexBarCore/Providers/LiteLLM/LiteLLMSettingsReader.swift:40` calls `setExtensionValue` and `Sources/CodexBarCore/Providers/Bifrost/BifrostSettingsReader.swift:21` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 10) Sources/CodexBar/Providers/Alibaba/AlibabaCodingPlanProviderImplementation.swift:7— Sources/CodexBar/Providers/Alibaba/AlibabaCodingPlanProviderImplementation.swift:7-12 | Sources/CodexBar/Providers/Alibaba/AlibabaTokenPlanProviderImplementation.swift:8-13 | Sources/CodexBar/Providers/DeepSeek/DeepSeekProviderImplementation.swift:8-13 | Sources/CodexBar/Providers/Devin/DevinProviderImplementation.swift:9-14 | Sources/CodexBar/Providers/Kimi/KimiProviderImplementation.swift:7-12 | Sources/CodexBar/Providers/LongCat/LongCatProviderImplementation.swift:7-12 | Sources/CodexBar/Providers/MiniMax/MiniMaxProviderImplementation.swift:7-12 | Sources/CodexBar/Providers/OpenCodeGo/OpenCodeGoProviderImplementation.swift:7-12 | Sources/CodexBar/Providers/QwenCloud/QwenCloudProviderImplementation.swift:7-12 | Sources/CodexBar/Providers/Venice/VeniceProviderImplementation.swift:8-13 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 10 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 10 times.
Duplicated block (6 lines × 5) Sources/CodexBarCore/Providers/Chutes/ChutesSettingsReader.swift:13— Sources/CodexBarCore/Providers/Chutes/ChutesSettingsReader.swift:13-20 | Sources/CodexBarCore/Providers/Codebuff/CodebuffSettingsReader.swift:15-20 | Sources/CodexBarCore/Providers/ElevenLabs/ElevenLabsSettingsReader.swift:19-24 | Sources/CodexBarCore/Providers/Groq/GroqSettingsReader.swift:13-20 | Sources/CodexBarCore/Providers/NeuralWatt/NeuralWattSettingsReader.swift:18-23 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times.
Duplicated block (6 lines × 9) Sources/CodexBar/Providers/Abacus/AbacusProviderImplementation.swift:7— Sources/CodexBar/Providers/Abacus/AbacusProviderImplementation.swift:7-12 | Sources/CodexBar/Providers/Augment/AugmentProviderImplementation.swift:7-12 | Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift:42-47 | Sources/CodexBar/Providers/CommandCode/CommandCodeProviderImplementation.swift:7-12 | Sources/CodexBar/Providers/Factory/FactoryProviderImplementation.swift:30-35 | Sources/CodexBar/Providers/Mistral/MistralProviderImplementation.swift:12-17 | Sources/CodexBar/Providers/Ollama/OllamaProviderImplementation.swift:31-36 | Sources/CodexBar/Providers/OpenCode/OpenCodeProviderImplementation.swift:24-31 | Sources/CodexBar/Providers/StepFun/StepFunProviderImplementation.swift:48-53 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 9 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 9 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `ProviderSettingsSnapshotContext` in one and `ProviderSourceModeContext` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 4) Sources/CodexBarCore/CookieHeaderCache+TestingOverrides.swift:14— Sources/CodexBarCore/CookieHeaderCache+TestingOverrides.swift:14-22 | Sources/CodexBarCore/CookieHeaderCache+TestingOverrides.swift:33-41 | Sources/CodexBarCore/CookieHeaderCache.swift:832-840 | Sources/CodexBarCore/KeychainAccessGate.swift:130-138 — there are 4 copies across 3 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.
Duplicated block (12–16 lines × 2) TestsLinux/CostUsageJsonlParitySupport.swift:68— TestsLinux/CostUsageJsonlParitySupport.swift:68-79 | TestsLinux/CostUsageJsonlParitySupport.swift:83-98 — 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 `TestsLinux/CostUsageJsonlParitySupport.swift:68` 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.
Sync-over-async blocking Sources/CodexBarCore/Providers/ProviderFetchPlan.swift:511— `sleep` is async and calls sleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Type Safety — 45 typed · 98 plain JS — the untyped files are Integrations/Linux/Shared/Notifications.js, Integrations/Linux/Shared/Usage.js, Integrations/Omarchy/notifications.test.mjs, Integrations/Omarchy/test.mjs, Scripts/check-app-locales.mjs, Scripts/check-documentation-links.mjs (+92 more).
R10 · Code Duplication· Duplicated block with local edits (276 matched lines × 2 locations) · ×1
Duplicated block with local edits (276 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/chutes.js:90— Sources/CodexBarCore/Resources/Plugins/chutes.js:90 · Sources/CodexBarCore/Resources/Plugins/chutes.ts:63 — the two spans are one implementation copied and then locally edited — 2370 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (221 matched lines × 2 locations) · ×1
Duplicated block with local edits (221 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/litellm.js:40— Sources/CodexBarCore/Resources/Plugins/litellm.js:40 · Sources/CodexBarCore/Resources/Plugins/litellm.ts:12 — the two spans are one implementation copied and then locally edited — 2237 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (219 matched lines × 2 locations) · ×1
Duplicated block with local edits (219 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/muse.js:39— Sources/CodexBarCore/Resources/Plugins/muse.js:39 · Sources/CodexBarCore/Resources/Plugins/muse.ts:11 — the two spans are one implementation copied and then locally edited — 2198 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (214 matched lines × 2 locations) · ×1
Duplicated block with local edits (214 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/huggingface.js:37— Sources/CodexBarCore/Resources/Plugins/huggingface.js:37 · Sources/CodexBarCore/Resources/Plugins/huggingface.ts:16 — the two spans are one implementation copied and then locally edited — 1862 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (166 identical lines × 2 files) Sources/CodexBarCore/Resources/Plugins/aixy.js:22— Sources/CodexBarCore/Resources/Plugins/aixy.js:22 · Sources/CodexBarCore/Resources/Plugins/aixy.ts:1 — these 2 files are line-for-line copies of one another — 166 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (152 matched lines × 2 locations) · ×1
Duplicated block with local edits (152 matched lines × 2 locations) REDACTED:40— REDACTED:40 · REDACTED:12 — the two spans are one implementation copied and then locally edited — 1301 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (149 matched lines × 2 locations) · ×1
Duplicated block with local edits (149 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/bifrost.js:39— Sources/CodexBarCore/Resources/Plugins/bifrost.js:39 · Sources/CodexBarCore/Resources/Plugins/bifrost.ts:11 — the two spans are one implementation copied and then locally edited — 1403 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (139 matched lines × 2 locations) · ×1
Duplicated block with local edits (139 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/munito.js:15— Sources/CodexBarCore/Resources/Plugins/munito.js:15 · Sources/CodexBarCore/Resources/Plugins/munito.ts:8 — the two spans are one implementation copied and then locally edited — 1200 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (138 identical lines × 2 files) Sources/CodexBarCore/Resources/Plugins/claudeplatform.js:8— Sources/CodexBarCore/Resources/Plugins/claudeplatform.js:8 · Sources/CodexBarCore/Resources/Plugins/claudeplatform.ts:1 — these 2 files are line-for-line copies of one another — 138 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (131 matched lines × 2 locations) · ×1
Duplicated block with local edits (131 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/qwencloud-team.js:37— Sources/CodexBarCore/Resources/Plugins/qwencloud-team.js:37 · Sources/CodexBarCore/Resources/Plugins/qwencloud-team.ts:9 — the two spans are one implementation copied and then locally edited — 1160 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (127 matched lines × 2 locations) · ×1
Duplicated block with local edits (127 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/v0.js:52— Sources/CodexBarCore/Resources/Plugins/v0.js:52 · Sources/CodexBarCore/Resources/Plugins/v0.ts:24 — the two spans are one implementation copied and then locally edited — 1111 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (123 matched lines × 2 locations) · ×1
Duplicated block with local edits (123 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/helmcode.js:58— Sources/CodexBarCore/Resources/Plugins/helmcode.js:58 · Sources/CodexBarCore/Resources/Plugins/helmcode.ts:32 — the two spans are one implementation copied and then locally edited — 1176 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (109 matched lines × 2 locations) · ×1
Duplicated block with local edits (109 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/typesafe.js:23— Sources/CodexBarCore/Resources/Plugins/typesafe.js:23 · Sources/CodexBarCore/Resources/Plugins/typesafe.ts:3 — the two spans are one implementation copied and then locally edited — 1017 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (104 identical lines × 2 files) Sources/CodexBarCore/Resources/Plugins/raycast.js:8— Sources/CodexBarCore/Resources/Plugins/raycast.js:8 · Sources/CodexBarCore/Resources/Plugins/raycast.ts:1 — these 2 files are line-for-line copies of one another — 104 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (98 matched lines × 2 locations) · ×1
Duplicated block with local edits (98 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/clinepass.js:33— Sources/CodexBarCore/Resources/Plugins/clinepass.js:33 · Sources/CodexBarCore/Resources/Plugins/clinepass.ts:22 — the two spans are one implementation copied and then locally edited — 624 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (93 identical lines × 2 files) Sources/CodexBarCore/Resources/Plugins/llmproxy.js:8— Sources/CodexBarCore/Resources/Plugins/llmproxy.js:8 · Sources/CodexBarCore/Resources/Plugins/llmproxy.ts:1 — these 2 files are line-for-line copies of one another — 93 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (93 matched lines × 2 locations) · ×1
Duplicated block with local edits (93 matched lines × 2 locations) REDACTED:18— REDACTED:18 · REDACTED:11 — the two spans are one implementation copied and then locally edited — 945 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (91 matched lines × 2 locations) · ×1
Duplicated block with local edits (91 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/gitkraken.js:41— Sources/CodexBarCore/Resources/Plugins/gitkraken.js:41 · Sources/CodexBarCore/Resources/Plugins/gitkraken.ts:14 — the two spans are one implementation copied and then locally edited — 809 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (89 identical lines × 2 files) Sources/CodexBarCore/Resources/Plugins/abacus.js:8— Sources/CodexBarCore/Resources/Plugins/abacus.js:8 · Sources/CodexBarCore/Resources/Plugins/abacus.ts:1 — these 2 files are line-for-line copies of one another — 89 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Duplicated block (86 lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/workbuddy.js:219— Sources/CodexBarCore/Resources/Plugins/workbuddy.js:219 · Sources/CodexBarCore/Resources/Plugins/workbuddy.ts:222 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (85 matched lines × 2 locations) · ×1
Duplicated block with local edits (85 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/futureagi.js:39— Sources/CodexBarCore/Resources/Plugins/futureagi.js:39 · Sources/CodexBarCore/Resources/Plugins/futureagi.ts:11 — the two spans are one implementation copied and then locally edited — 675 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (85 identical lines × 2 files) Sources/CodexBarCore/Resources/Plugins/lithosai.js:8— Sources/CodexBarCore/Resources/Plugins/lithosai.js:8 · Sources/CodexBarCore/Resources/Plugins/lithosai.ts:1 — these 2 files are line-for-line copies of one another — 85 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (82 matched lines × 2 locations) · ×1
Duplicated block with local edits (82 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/llmman.js:31— Sources/CodexBarCore/Resources/Plugins/llmman.js:31 · Sources/CodexBarCore/Resources/Plugins/llmman.ts:10 — the two spans are one implementation copied and then locally edited — 863 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (76 matched lines × 2 locations) · ×1
Duplicated block with local edits (76 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/gemini-web.js:47— Sources/CodexBarCore/Resources/Plugins/gemini-web.js:47 · Sources/CodexBarCore/Resources/Plugins/gemini-web.ts:28 — the two spans are one implementation copied and then locally edited — 643 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (73 identical lines × 2 files) REDACTED:1— REDACTED:1 · REDACTED:1 — these 2 files are line-for-line copies of one another — 73 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Wholesale file copy (69 identical lines × 2 files) Sources/CodexBarCore/Resources/Plugins/langdock.js:1— Sources/CodexBarCore/Resources/Plugins/langdock.js:1 · Sources/CodexBarCore/Resources/Plugins/langdock.ts:1 — these 2 files are line-for-line copies of one another — 69 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Duplicated block (67 lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/workbuddy.js:81— Sources/CodexBarCore/Resources/Plugins/workbuddy.js:81 · Sources/CodexBarCore/Resources/Plugins/workbuddy.ts:80 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (63 matched lines × 2 locations) · ×1
Duplicated block with local edits (63 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/ollama-api.js:37— Sources/CodexBarCore/Resources/Plugins/ollama-api.js:37 · Sources/CodexBarCore/Resources/Plugins/ollama-api.ts:16 — the two spans are one implementation copied and then locally edited — 595 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (62 matched lines × 2 locations) · ×1
Duplicated block with local edits (62 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/parallel.js:15— Sources/CodexBarCore/Resources/Plugins/parallel.js:15 · Sources/CodexBarCore/Resources/Plugins/parallel.ts:8 — the two spans are one implementation copied and then locally edited — 522 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (58 identical lines × 2 files) Sources/CodexBarCore/Resources/Plugins/sofya.js:8— Sources/CodexBarCore/Resources/Plugins/sofya.js:8 · Sources/CodexBarCore/Resources/Plugins/sofya.ts:1 — these 2 files are line-for-line copies of one another — 58 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Wholesale file copy (57 identical lines × 2 files) REDACTED:1— REDACTED:1 · REDACTED:1 — these 2 files are line-for-line copies of one another — 57 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Wholesale file copy (56 identical lines × 2 files) Sources/CodexBarCore/Resources/Plugins/siliconflow.js:1— Sources/CodexBarCore/Resources/Plugins/siliconflow.js:1 · Sources/CodexBarCore/Resources/Plugins/siliconflow.ts:1 — these 2 files are line-for-line copies of one another — 56 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (51 matched lines × 2 locations) · ×1
Duplicated block with local edits (51 matched lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/xkiro.js:36— Sources/CodexBarCore/Resources/Plugins/xkiro.js:36 · Sources/CodexBarCore/Resources/Plugins/xkiro.ts:8 — the two spans are one implementation copied and then locally edited — 549 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (49 matched lines × 2 locations) · ×1
Duplicated block with local edits (49 matched lines × 2 locations) REDACTED:11— REDACTED:11 · REDACTED:11 — the two spans are one implementation copied and then locally edited — 438 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (43 lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/hyper.js:46— Sources/CodexBarCore/Resources/Plugins/hyper.js:46 · Sources/CodexBarCore/Resources/Plugins/hyper.ts:25 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (42 lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/zoommate.js:261— Sources/CodexBarCore/Resources/Plugins/zoommate.js:261 · Sources/CodexBarCore/Resources/Plugins/zoommate.ts:204 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (38 lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/workbuddy.js:167— Sources/CodexBarCore/Resources/Plugins/workbuddy.js:167 · Sources/CodexBarCore/Resources/Plugins/workbuddy.ts:170 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (36 lines × 2 locations) Sources/CodexBarCore/Resources/Plugins/aiand.js:67— Sources/CodexBarCore/Resources/Plugins/aiand.js:67 · Sources/CodexBarCore/Resources/Plugins/aiand.ts:27 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Complex function fetchUsage (cyclomatic 116, cognitive 202) Sources/CodexBarCore/Resources/Plugins/openrouter.js:24— fetchUsage has cyclomatic complexity 116 and cognitive complexity 202; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 75, cognitive 96) Sources/CodexBarCore/Resources/Plugins/zai.js:24— fetchUsage has cyclomatic complexity 75 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 62, cognitive 87) Sources/CodexBarCore/Resources/Plugins/openai.js:14— fetchUsage has cyclomatic complexity 62 and cognitive complexity 87; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 60, cognitive 114) Sources/CodexBarCore/Resources/Plugins/zoommate.ts:18— fetchUsage has cyclomatic complexity 60 and cognitive complexity 114; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 59, cognitive 64) REDACTED:11— fetchUsage has cyclomatic complexity 59 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 58, cognitive 87) Sources/CodexBarCore/Resources/Plugins/huggingface.ts:16— fetchUsage has cyclomatic complexity 58 and cognitive complexity 87; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 57, cognitive 74) Sources/CodexBarCore/Resources/Plugins/poe.js:15— fetchUsage has cyclomatic complexity 57 and cognitive complexity 74; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 55, cognitive 60) REDACTED:39— fetchUsage has cyclomatic complexity 55 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 54, cognitive 108) Sources/CodexBarCore/Resources/Plugins/zoommate.js:53— fetchUsage has cyclomatic complexity 54 and cognitive complexity 108; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 54, cognitive 84) Sources/CodexBarCore/Resources/Plugins/huggingface.js:37— fetchUsage has cyclomatic complexity 54 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 52, cognitive 55) Sources/CodexBarCore/Resources/Plugins/sub2api.js:10— fetchUsage has cyclomatic complexity 52 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 50, cognitive 79) Sources/CodexBarCore/Resources/Plugins/litellm.ts:12— fetchUsage has cyclomatic complexity 50 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 50, cognitive 58) Sources/CodexBarCore/Resources/Plugins/munito.ts:8— fetchUsage has cyclomatic complexity 50 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 45, cognitive 54) Sources/CodexBarCore/Resources/Plugins/munito.js:15— fetchUsage has cyclomatic complexity 45 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 44, cognitive 51) REDACTED:10— fetchUsage has cyclomatic complexity 44 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 43, cognitive 38) REDACTED:11— fetchUsage has cyclomatic complexity 43 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 41, cognitive 73) Sources/CodexBarCore/Resources/Plugins/workbuddy.ts:19— fetchUsage has cyclomatic complexity 41 and cognitive complexity 73; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 41, cognitive 70) Sources/CodexBarCore/Resources/Plugins/litellm.js:40— fetchUsage has cyclomatic complexity 41 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 41, cognitive 50) Sources/CodexBarCore/Resources/Plugins/t3chat.js:12— fetchUsage has cyclomatic complexity 41 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 41, cognitive 45) Sources/CodexBarCore/Resources/Plugins/perplexity.js:8— fetchUsage has cyclomatic complexity 41 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 39, cognitive 47) REDACTED:11— fetchUsage has cyclomatic complexity 39 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 38, cognitive 72) Sources/CodexBarCore/Resources/Plugins/claudeplatform.ts:14— fetchUsage has cyclomatic complexity 38 and cognitive complexity 72; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 38, cognitive 40) REDACTED:15— fetchUsage has cyclomatic complexity 38 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 37, cognitive 69) Sources/CodexBarCore/Resources/Plugins/workbuddy.js:26— fetchUsage has cyclomatic complexity 37 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 37, cognitive 51) Sources/CodexBarCore/Resources/Plugins/qwencloud-team.js:37— fetchUsage has cyclomatic complexity 37 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 37, cognitive 44) Sources/CodexBarCore/Resources/Plugins/raycast.ts:8— fetchUsage has cyclomatic complexity 37 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 35, cognitive 45) Sources/CodexBarCore/Resources/Plugins/longcat.ts:9— fetchUsage has cyclomatic complexity 35 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 35, cognitive 42) Sources/CodexBarCore/Resources/Plugins/raycast.js:15— fetchUsage has cyclomatic complexity 35 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 33, cognitive 64) Sources/CodexBarCore/Resources/Plugins/claudeplatform.js:21— fetchUsage has cyclomatic complexity 33 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fetchUsage (cyclomatic 33, cognitive 34) REDACTED:11— fetchUsage has cyclomatic complexity 33 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· Integrations/Omarchy/test.mjs · ×1
Integrations/Omarchy/test.mjs: 771 lines of code Integrations/Omarchy/test.mjs:1— Integrations/Omarchy/test.mjs has 771 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· Sources/CodexBarCore/Resources/Plugins/openrouter.js · ×1
Sources/CodexBarCore/Resources/Plugins/openrouter.js: 431 lines of code Sources/CodexBarCore/Resources/Plugins/openrouter.js:1— Sources/CodexBarCore/Resources/Plugins/openrouter.js has 431 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· Sources/CodexBarCore/Resources/Plugins/openai.js · ×1
Sources/CodexBarCore/Resources/Plugins/openai.js: 409 lines of code Sources/CodexBarCore/Resources/Plugins/openai.js:1— Sources/CodexBarCore/Resources/Plugins/openai.js has 409 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~453 LoC) Sources/CodexBarCore/Resources/Plugins/chutes.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~443 LoC) Sources/CodexBarCore/Resources/Plugins/openrouter.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~413 LoC) Sources/CodexBarCore/Resources/Plugins/openai.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~386 LoC) Sources/CodexBarCore/Resources/Plugins/chutes.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~359 LoC) Sources/CodexBarCore/Resources/Plugins/bifrost.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~316 LoC) Sources/CodexBarCore/Resources/Plugins/bifrost.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~311 LoC) Sources/CodexBarCore/Resources/Plugins/workbuddy.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~310 LoC) REDACTED— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~298 LoC) Sources/CodexBarCore/Resources/Plugins/litellm.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~291 LoC) Sources/CodexBarCore/Resources/Plugins/huggingface.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~281 LoC) Sources/CodexBarCore/Resources/Plugins/muse.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~279 LoC) Sources/CodexBarCore/Resources/Plugins/notion.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~245 LoC) Sources/CodexBarCore/Resources/Plugins/huggingface.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~244 LoC) Sources/CodexBarCore/Resources/Plugins/litellm.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~238 LoC) Sources/CodexBarCore/Resources/Plugins/aixy.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~226 LoC) Sources/CodexBarCore/Resources/Plugins/longcat.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~222 LoC) Sources/CodexBarCore/Resources/Plugins/sub2api.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~212 LoC) Sources/CodexBarCore/Resources/Plugins/v0.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~201 LoC) REDACTED— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~189 LoC) Sources/CodexBarCore/Resources/Plugins/helmcode.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~183 LoC) Sources/CodexBarCore/Resources/Plugins/notion.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~181 LoC) Sources/CodexBarCore/Resources/Plugins/qwencloud-team.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~179 LoC) Sources/CodexBarCore/Resources/Plugins/poe.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~171 LoC) REDACTED— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~168 LoC) Sources/CodexBarCore/Resources/Plugins/munito.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~166 LoC) Sources/CodexBarCore/Resources/Plugins/raycast.ts— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~164 LoC) Sources/CodexBarCore/Resources/Plugins/munito.js— no import path from any entry point (26 application, 14 tooling, 6 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Duplicated predicate Sources/CodexBarCore/Resources/Plugins/replicate.js:74— `!/\bid\s*=\s*(["'])react-component-props[^"']*\1/i.test(match[1]) || !/\btype\s*=\s*(["'])application\/json\1/i.test(match[1])` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/replicate.js, Sources/CodexBarCore/Resources/Plugins/replicate.ts. 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 REDACTED:134— `!Array.isArray(details) || details.length > 100` appears character-identically in 2 files — REDACTED, REDACTED. 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 Sources/CodexBarCore/Resources/Plugins/litellm.js:244— `!Array.isArray(root.results) || root.results.length > 31` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/litellm.js, Sources/CodexBarCore/Resources/Plugins/litellm.ts. 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 REDACTED:16— `!Number.isFinite(amount) || (!signed && amount < 0)` appears character-identically in 2 files — REDACTED, REDACTED. 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 Sources/CodexBarCore/Resources/Plugins/zoommate.js:252— `!Number.isFinite(date.getTime()) || date < since` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/zoommate.js, Sources/CodexBarCore/Resources/Plugins/zoommate.ts. 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 Sources/CodexBarCore/Resources/Plugins/ollama-api.js:62— `!Number.isFinite(date.getTime()) || day > new Date(Date.UTC(year, month, 0)).getUTCDate()` appears character-identically in 4 files — Sources/CodexBarCore/Resources/Plugins/ollama-api.js, Sources/CodexBarCore/Resources/Plugins/ollama-api.ts, Sources/CodexBarCore/Resources/Plugins/sofya.js, Sources/CodexBarCore/Resources/Plugins/sofya.ts. 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 Sources/CodexBarCore/Resources/Plugins/huggingface.js:63— `!Number.isFinite(value) || value <= 0 || value > 64092211200` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/huggingface.js, Sources/CodexBarCore/Resources/Plugins/huggingface.ts. 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 Sources/CodexBarCore/Resources/Plugins/huggingface.js:226— `!Number.isInteger(scalar) || scalar > 0x10ffff || (scalar >= 0xd800 && scalar <= 0xdfff)` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/huggingface.js, Sources/CodexBarCore/Resources/Plugins/huggingface.ts. 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 Sources/CodexBarCore/Resources/Plugins/aiand.js:51— `!Number.isInteger(scale) || exponent < -128 || exponent > 127 || scale > 128` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/aiand.js, Sources/CodexBarCore/Resources/Plugins/aiand.ts. 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 REDACTED:153— `!Number.isSafeInteger(detailRewards.used) || !Number.isSafeInteger(detailRewards.limit)` appears character-identically in 2 files — REDACTED, REDACTED. 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 Sources/CodexBarCore/Resources/Plugins/qwencloud-team.js:166— `!Number.isSafeInteger(millis) || millis <= 0` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/qwencloud-team.js, Sources/CodexBarCore/Resources/Plugins/qwencloud-team.ts. 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 Sources/CodexBarCore/Resources/Plugins/muse.js:269— `!Number.isSafeInteger(minutes) || minutes <= 0` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/muse.js, Sources/CodexBarCore/Resources/Plugins/muse.ts. 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 Sources/CodexBarCore/Resources/Plugins/qwencloud-team.js:127— `!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start <= 0 || end <= start` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/qwencloud-team.js, Sources/CodexBarCore/Resources/Plugins/qwencloud-team.ts. 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 Sources/CodexBarCore/Resources/Plugins/aixy.js:119— `!["organization", "project", "team", "user", "api_key"].includes(scope) || !["daily", "weekly", "monthly", "lifetime"].includes(interval)` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/aixy.js, Sources/CodexBarCore/Resources/Plugins/aixy.ts. 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 Sources/CodexBarCore/Resources/Plugins/tripo.js:32— `!body || typeof body !== "object" || Array.isArray(body) || !Number.isInteger(body.code)` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/tripo.js, Sources/CodexBarCore/Resources/Plugins/tripo.ts. 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 Sources/CodexBarCore/Resources/Plugins/tripo.js:34— `!body.data || typeof body.data !== "object" || Array.isArray(body.data)` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/tripo.js, Sources/CodexBarCore/Resources/Plugins/tripo.ts. 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 Sources/CodexBarCore/Resources/Plugins/chutes.js:386— `!chutesObject(value) && !Array.isArray(value)` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/chutes.js, Sources/CodexBarCore/Resources/Plugins/chutes.ts. 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 Sources/CodexBarCore/Resources/Plugins/fal.js:37— `!credits || typeof credits !== "object" || Array.isArray(credits)` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/fal.js, Sources/CodexBarCore/Resources/Plugins/openrouter.js. 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 Sources/CodexBarCore/Resources/Plugins/aiand.js:95— `!data || !Array.isArray(data.data) || (data.has_more != null && typeof data.has_more !== "boolean")` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/aiand.js, Sources/CodexBarCore/Resources/Plugins/aiand.ts. 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 Sources/CodexBarCore/Resources/Plugins/devpass.js:59— `!data || !["none", "lite", "pro", "max"].includes(data.devPlan)` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/devpass.js, Sources/CodexBarCore/Resources/Plugins/devpass.ts. 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 Sources/CodexBarCore/Resources/Plugins/parallel.js:79— `!data || typeof data !== "object" || !finite(data.balance)` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/parallel.js, Sources/CodexBarCore/Resources/Plugins/parallel.ts. 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 Sources/CodexBarCore/Resources/Plugins/clinepass.js:76— `!data || typeof data !== "object" || Array.isArray(data)` appears character-identically in 13 files — Sources/CodexBarCore/Resources/Plugins/clinepass.js, Sources/CodexBarCore/Resources/Plugins/clinepass.ts, REDACTED, REDACTED. 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 Sources/CodexBarCore/Resources/Plugins/litellm.js:248— `!day || !/^\d{4}-\d{2}-\d{2}$/u.test(day) || day < start || day > end` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/litellm.js, Sources/CodexBarCore/Resources/Plugins/litellm.ts. 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 Sources/CodexBarCore/Resources/Plugins/huggingface.js:145— `!identity || now.getTime() - identity.fetchedAt < 0 || now.getTime() - identity.fetchedAt >= 43200000` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/huggingface.js, Sources/CodexBarCore/Resources/Plugins/huggingface.ts. 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 Sources/CodexBarCore/Resources/Plugins/replicate.js:126— `!invoice || invoice.type !== "monthly-usage"` appears character-identically in 2 files — Sources/CodexBarCore/Resources/Plugins/replicate.js, Sources/CodexBarCore/Resources/Plugins/replicate.ts. 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.
Silent fallback default in catch Sources/CodexBar/UsageStore/UsageStore+ProviderStorage.swift:279— `loadManagedCodexAccountsForStorage` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCLI/ToonFormatter.swift:13— `encode` turns every thrown error into `""` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/ChromiumLocalStorageDiscovery.swift:70— `profileCandidates` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/CodexWorkspaceUsageFingerprint.swift:47— `make` turns every thrown error into `"unavailable"` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Plugins/QuickJSProviderPluginEngine.swift:164— `stringValue` turns every thrown error into `""` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Host/PTY/TTYCommandRunner.swift:165— `currentChildPIDs` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Host/Process/SpawnedProcessGroup.swift:249— `allProcessIDs` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift:284— `allCaptures` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Antigravity/AntigravityOfflineStore.swift:89— `countDBFiles` turns every thrown error into `0` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Antigravity/AntigravityOfflineStore.swift:97— `countJSONLFiles` turns every thrown error into `0` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe+PortDetection.swift:131— `parseListeningPorts` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe+PortDetection.swift:160— `socketInodes` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Claude/ClaudeCLIScreen.swift:23— `render` turns every thrown error into `""` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Cursor/CursorLocalCSVReader.swift:25— `cachedCSVPaths` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift:1055— `parseModelUsageTable` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Shared/OpenCodeWebParsing.swift:166— `parseWorkspaceIDs` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner.swift:3421— `listCodexSessionFilesFlat` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapRetainedUsageStore.swift:23— `decode` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:975— `extractEmails` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:990— `extractPlanHints` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:1005— `extractNotableFields` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Scripts/StoreStress/main.swift:392— `descriptorCount` turns every thrown error into `-1` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Orphaned file Sources/CodexBarCore/Providers/Groq/GroqConsoleFetcher.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Groq/GroqConsoleSession.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Plugins/ProviderPluginSelectedProfile.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthKeychainAccessGate.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Bedrock/BedrockAWSSigner.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Shared/CurlCaptureParser.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBar/Providers/Codex/CodexHistoryOwnership.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Abacus/AbacusCookieImporter.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Perplexity/PerplexityCookieHeader.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageSnapshot.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBar/Providers/Cursor/CursorLoginAccountSelector.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Groq/GroqConsoleStytch.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Codex/CodexOpenAIWorkspaceIdentityCache.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBar/Providers/Gemini/GeminiLoginRunner.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Claude/ClaudeCredentialRouting.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Bedrock/BedrockCredentialResolver.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Codex/CodexCLIDashboardAuthorityContext.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Codex/CodexSystemAccountObserver.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Factory/FactorySettingsReader.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/CodexBarCore/Providers/Factory/FactoryStatusProbe+APIKey.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 66 significant file(s) lose their only recent owner: Sources/CodexBar/Providers/Codex/OpenAICreditsPurchaseWindowController.swift, Sources/CodexBar/Settings/PreferencesPluginsPane.swift, Sources/CodexBar/Menu/MenuSwitchFlickerProbe.swift, Sources/CodexBar/Providers/OpenAI/OpenAILiveUsageView.swift, Sources/CodexBarCore/Resources/Plugins/chutes.ts, Sources/CodexBarCore/Resources/Plugins/bifrost.ts, Sources/CodexBar/UsageStore/UsageStore+UserPlugins.swift, Sources/CodexBarCore/Resources/Plugins/huggingface.ts (+58 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 7 significant file(s) lose their only recent owner: Scripts/ci_swiftpm_cache.py, Sources/CodexBar/SpendDashboard/SpendSessionPerformanceView.swift, Sources/CodexBarCore/SessionToolActivityStore.swift, Sources/CodexBarCLI/CLICodexAccountsCommand.swift, Sources/CodexBarCLI/CLIConfigSourceCommand.swift, Sources/CodexBarCore/CostUsageTurnPerformance.swift, Sources/CodexBar/Menu/CostHistoryMenuScrollView.swift. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 5 significant file(s) lose their only recent owner: Sources/CodexBarCore/Providers/QwenCloud/QwenCloudUsageFetcher.swift, Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleSECTokenResolver.swift, Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/AliyunOneConsoleCookieImporter.swift, Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/OneConsoleCookieRouting.swift, Sources/CodexBarCore/Providers/QwenCloud/QwenCloudCookieImporter.swift. Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 22 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (104 single-owned of 993 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 993 of the 1460 production source files in this repository met that bar). They are anonymized user #4 (2 file(s)), anonymized user #5 (2 file(s)), anonymized user #6 (2 file(s)), anonymized user #7 (2 file(s)), anonymized user #8 (1 file(s)), anonymized user #9 (1 file(s)) (+16 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: Sources/CodexBarCore/CodexLocalProjectUsageModels.swift, Sources/CodexBarCore/CodexThreadCatalogReader.swift, Sources/CodexBarCore/Plugins/ProviderBrowserProfile.swift, Sources/CodexBar/Providers/Shared/PluginCookieProviderImplementation+Profile.swift, Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeSubscriptionMetadata.swift, Sources/CodexBarCore/OpenAIWeb/OpenAISubscriptionMetadata.swift, Sources/CodexBarCore/Providers/Kimi/KimiDesktopSessionDiscovery.swift, Sources/CodexBarCore/Providers/Kimi/KimiWebCredential.swift (+18 more).
D20 · ADR Quality· ADR has no Context section · ×1
ADR has no Context section docs/predictive-refresh-policy.md:9— docs/predictive-refresh-policy.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D21 · Naming Consistency· `webDebugDumpHtml` spells `Html` where 23 names in the project spell it `HTML` · ×1
`webDebugDumpHtml` spells `Html` where 23 names in the project spell it `HTML` Sources/CodexBarCLI/CLIOptions.swift:205— 23 of 24 names in project AdaptiveRefreshCore spell the token `HTML` (23 of 24; unit: names in project AdaptiveRefreshCore containing `HTML`). Peers: CLIServeWebUI.renderedHTML (Sources/CodexBarCLI/CLIServeWebUI.swift:32); UsageCommandContext.webDebugDumpHTML (Sources/CodexBarCLI/CLIUsageCommand.swift:11); OpenAIDashboardFetcher.loadLatestDashboard(debugDumpHTML) (Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:221); OpenAIDashboardFetcher.loadLatestDashboard(debugDumpHTML) (Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:242); OpenAIDashboardFetcher.fetchDebugHTML (Sources/CodexBarCore/OpenAIWeb/OpenAIDashboardFetcher.swift:535). Rename to `webDebugDumpHTML`. [rule N6]
D21 · Naming Consistency· `minimaxApiTokenRegex` spells `Api` where 205 names in the project spell it `API` · ×1
`minimaxApiTokenRegex` spells `Api` where 205 names in the project spell it `API` Sources/CodexBarCore/Logging/LogRedactor.swift:23— 205 of 210 names in project AdaptiveRefreshCore spell the token `API` (205 of 210; unit: names in project AdaptiveRefreshCore containing `API`). Peers: LegacyStores.minimaxAPITokenStore (Sources/CodexBar/Config/CodexBarConfigMigrator.swift:14); CodexBarConfigMigrator.bindLegacyMoonshotAPIKeyRegion (Sources/CodexBar/Config/CodexBarConfigMigrator.swift:253); Model.providerCostFollowsSummaryStyle(isClaudeAdminAPI) (Sources/CodexBar/Menu/MenuCardView+Costs.swift:116); Model.providerCostSection(isClaudeAdminAPI) (Sources/CodexBar/Menu/MenuCardView+Costs.swift:469); Model.sub2APILocalizedDetails (Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:616). Rename to `minimaxAPITokenRegex`. [rule N6]
D21 · Naming Consistency· `claudeAiOauth` spells `Ai` where 206 names in the project spell it `AI` · ×1
`claudeAiOauth` spells `Ai` where 206 names in the project spell it `AI` Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentialModels.swift:126— 206 of 207 names in project AdaptiveRefreshCore spell the token `AI` (206 of 207; unit: names in project AdaptiveRefreshCore containing `AI`). Peers: MemoryPressureCacheTrimSummary.openAIWebDebugLines (Sources/CodexBar/MemoryPressureMonitor.swift:11); CodexBar.AzureOpenAIProviderImplementation (Sources/CodexBar/Providers/AzureOpenAI/AzureOpenAIProviderImplementation.swift:4); SettingsStore.azureOpenAIEndpoint (Sources/CodexBar/Providers/AzureOpenAI/AzureOpenAISettingsStore.swift:19); SettingsStore.azureOpenAIDeploymentName (Sources/CodexBar/Providers/AzureOpenAI/AzureOpenAISettingsStore.swift:28); CodexUIErrorMapper.looksOpenAIWebTimeout (Sources/CodexBar/Providers/Codex/CodexConsumerProjection.swift:158). Rename to `claudeAIOauth`. [rule N6]
D21 · Naming Consistency· `isApiOnly` spells `Api` where 205 names in the project spell it `API` · ×1
`isApiOnly` spells `Api` where 205 names in the project spell it `API` Sources/CodexBarCore/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift:1479— 205 of 210 names in project AdaptiveRefreshCore spell the token `API` (205 of 210; unit: names in project AdaptiveRefreshCore containing `API`). Peers: LegacyStores.minimaxAPITokenStore (Sources/CodexBar/Config/CodexBarConfigMigrator.swift:14); CodexBarConfigMigrator.bindLegacyMoonshotAPIKeyRegion (Sources/CodexBar/Config/CodexBarConfigMigrator.swift:253); Model.providerCostFollowsSummaryStyle(isClaudeAdminAPI) (Sources/CodexBar/Menu/MenuCardView+Costs.swift:116); Model.providerCostSection(isClaudeAdminAPI) (Sources/CodexBar/Menu/MenuCardView+Costs.swift:469); Model.sub2APILocalizedDetails (Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:616). Rename to `isAPIOnly`. [rule N6]
D21 · Naming Consistency· `librariesApi` spells `Api` where 205 names in the project spell it `API` · ×1
`librariesApi` spells `Api` where 205 names in the project spell it `API` Sources/CodexBarCore/Providers/Mistral/MistralModels.swift:12— 205 of 210 names in project AdaptiveRefreshCore spell the token `API` (205 of 210; unit: names in project AdaptiveRefreshCore containing `API`). Peers: LegacyStores.minimaxAPITokenStore (Sources/CodexBar/Config/CodexBarConfigMigrator.swift:14); CodexBarConfigMigrator.bindLegacyMoonshotAPIKeyRegion (Sources/CodexBar/Config/CodexBarConfigMigrator.swift:253); Model.providerCostFollowsSummaryStyle(isClaudeAdminAPI) (Sources/CodexBar/Menu/MenuCardView+Costs.swift:116); Model.providerCostSection(isClaudeAdminAPI) (Sources/CodexBar/Menu/MenuCardView+Costs.swift:469); Model.sub2APILocalizedDetails (Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:616). Rename to `librariesAPI`. [rule N6]
D21 · Naming Consistency· `VibeJson` spells `Json` where 110 names in the project spell it `JSON` · ×1
`VibeJson` spells `Json` where 110 names in the project spell it `JSON` Sources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swift:517— 110 of 111 names in project AdaptiveRefreshCore spell the token `JSON` (110 of 111; unit: names in project AdaptiveRefreshCore containing `JSON`). Peers: AdaptiveReplayCLI.renderJSON (Sources/AdaptiveReplayCLI/main.swift:123); SpendDashboardPane.copyJSON (Sources/CodexBar/Settings/PreferencesSpendDashboardPane.swift:555); SpendDashboardPane.exportJSON (Sources/CodexBar/Settings/PreferencesSpendDashboardPane.swift:561); CodexBar.SpendDashboardJSONExporter (Sources/CodexBar/Settings/PreferencesSpendDashboardPane.swift:1310); CodexIdentifiedResult.localLedgerJSON (Sources/CodexBarCLI/CLICodexIdentifiedUsage.swift:18). Rename to `VibeJSON`. [rule N6]
D21 · Naming Consistency· `modifiedUnixNs` spells `Ns` where 29 names in the project spell it `NS` · ×1
`modifiedUnixNs` spells `Ns` where 29 names in the project spell it `NS` Sources/CodexBarCore/Providers/OpenCode/OpenCodeSourceCheckpoint.swift:41— 29 of 31 names in project AdaptiveRefreshCore spell the token `NS` (29 of 31; unit: names in project AdaptiveRefreshCore containing `NS`). Peers: ClickToCopyOverlay.makeNSView (Sources/CodexBar/ClickToCopyOverlay.swift:36); ClickToCopyOverlay.updateNSView (Sources/CodexBar/ClickToCopyOverlay.swift:40); MenuBarLayoutPreviewText.makeNSView (Sources/CodexBar/Menu/MenuBarLayoutEditor.swift:1085); MenuBarLayoutPreviewText.updateNSView (Sources/CodexBar/Menu/MenuBarLayoutEditor.swift:1091); SessionUsageMenuAction.makeNSView (Sources/CodexBar/Menu/SessionUsageMenuAction.swift:9). Rename to `modifiedUnixNS`. [rule N6]
D21 · Naming Consistency· `walModifiedUnixNs` spells `Ns` where 29 names in the project spell it `NS` · ×1
`walModifiedUnixNs` spells `Ns` where 29 names in the project spell it `NS` Sources/CodexBarCore/Providers/OpenCode/OpenCodeSourceCheckpoint.swift:42— 29 of 31 names in project AdaptiveRefreshCore spell the token `NS` (29 of 31; unit: names in project AdaptiveRefreshCore containing `NS`). Peers: ClickToCopyOverlay.makeNSView (Sources/CodexBar/ClickToCopyOverlay.swift:36); ClickToCopyOverlay.updateNSView (Sources/CodexBar/ClickToCopyOverlay.swift:40); MenuBarLayoutPreviewText.makeNSView (Sources/CodexBar/Menu/MenuBarLayoutEditor.swift:1085); MenuBarLayoutPreviewText.updateNSView (Sources/CodexBar/Menu/MenuBarLayoutEditor.swift:1091); SessionUsageMenuAction.makeNSView (Sources/CodexBar/Menu/SessionUsageMenuAction.swift:9). Rename to `walModifiedUnixNS`. [rule N6]
D21 · Naming Consistency· `TinyApiProviderDescriptor` spells `Api` where 205 names in the project spell it `API` · ×1
`TinyApiProviderDescriptor` spells `Api` where 205 names in the project spell it `API` Sources/CodexBarCore/Providers/TinyApi/TinyApiProviderDescriptor.swift:3— 205 of 210 names in project AdaptiveRefreshCore spell the token `API` (205 of 210; unit: names in project AdaptiveRefreshCore containing `API`). Peers: LegacyStores.minimaxAPITokenStore (Sources/CodexBar/Config/CodexBarConfigMigrator.swift:14); CodexBarConfigMigrator.bindLegacyMoonshotAPIKeyRegion (Sources/CodexBar/Config/CodexBarConfigMigrator.swift:253); Model.providerCostFollowsSummaryStyle(isClaudeAdminAPI) (Sources/CodexBar/Menu/MenuCardView+Costs.swift:116); Model.providerCostSection(isClaudeAdminAPI) (Sources/CodexBar/Menu/MenuCardView+Costs.swift:469); Model.sub2APILocalizedDetails (Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:616). Rename to `TinyAPIProviderDescriptor`. [rule N6]
D21 · Naming Consistency· `TinyApiProviderSettingsKey` spells `Api` where 205 names in the project spell it `API` · ×1
`TinyApiProviderSettingsKey` spells `Api` where 205 names in the project spell it `API` Sources/CodexBarCore/Providers/TinyApi/TinyApiProviderDescriptor.swift:45— 205 of 210 names in project AdaptiveRefreshCore spell the token `API` (205 of 210; unit: names in project AdaptiveRefreshCore containing `API`). Peers: LegacyStores.minimaxAPITokenStore (Sources/CodexBar/Config/CodexBarConfigMigrator.swift:14); CodexBarConfigMigrator.bindLegacyMoonshotAPIKeyRegion (Sources/CodexBar/Config/CodexBarConfigMigrator.swift:253); Model.providerCostFollowsSummaryStyle(isClaudeAdminAPI) (Sources/CodexBar/Menu/MenuCardView+Costs.swift:116); Model.providerCostSection(isClaudeAdminAPI) (Sources/CodexBar/Menu/MenuCardView+Costs.swift:469); Model.sub2APILocalizedDetails (Sources/CodexBar/Menu/MenuCardView+ModelHelpers.swift:616). Rename to `TinyAPIProviderSettingsKey`. [rule N6]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (312318 LoC, 3653 module-visible types across 226 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 20 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: Sources/CodexBarCore/Providers/Groq/GroqConsoleFetcher.swift, Sources/CodexBarCore/Providers/Groq/GroqConsoleSession.swift, Sources/CodexBarCore/Plugins/ProviderPluginSelectedProfile.swift, Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthKeychainAccessGate.swift, Sources/CodexBarCore/Providers/Bedrock/BedrockAWSSigner.swift, Sources/CodexBarCore/Providers/Shared/CurlCaptureParser.swift, Sources/CodexBar/Providers/Codex/CodexHistoryOwnership.swift, Sources/CodexBarCore/Providers/Abacus/AbacusCookieImporter.swift (and 12 more) (21 orphaned of 994 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 994 of the 1460 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
M2 · Architecture documentation· ADRs not easily discoverable · ×1
ADRs not easily discoverable — 1 ADR-shaped document(s) detected by content — `docs/predictive-refresh-policy.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
Logging is not universal — Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.
No SAST REDACTED:6— No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 7 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.
Null assertions (`!`) override strict null checking — ~2.3 `!` null assertions per 1k TypeScript source lines — 15 assertion(s) across the 6547 source line(s) of the 45 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: Sources/CodexBarCore/Resources/Plugins/aixy.ts (7), Sources/CodexBarCore/Resources/Plugins/litellm.ts (3), Sources/CodexBarCore/Resources/Plugins/bifrost.ts (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Hand-rolled JSON/XML parsing via regex Sources/CodexBarCore/Providers/Shared/OpenCodeWebParsing.swift:83— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Skipped (documented): Tests/CodexBarTests/CodexDayAttributionTests.swift:6— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): Tests/CodexBarTests/CostReportingPeriodProofTests.swift:7— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): Tests/CodexBarTests/KeychainAccessGateConcurrencyTests.swift:20— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): Tests/CodexBarTests/LiveAccountTests.swift:8— Skipped with a documented reason — a deferral, not lazy debt: Set LIVE_TEST=1 to run live Codex account checks.
Skipped (documented): Tests/CodexBarTests/QwenCloudProviderTests.swift:818— Skipped with a documented reason — a deferral, not lazy debt: Set QWEN_CLOUD_LIVE_TEST=1 and QWEN_CLOUD_COOKIE to run live Qwen Cloud checks.
Skipped (documented): Tests/CodexBarTests/StubURLProtocolHandlerConcurrencyTests.swift:15— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): Tests/CodexBarTests/WidgetHeadlineLocalizationTests.swift:10— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Outdated: sweetcookiekit — `sweetcookiekit` is resolved at 0.5.11, but 0.6.0 is the newest release tagged on https://github.com/steipete/SweetCookieKit within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update sweetcookiekit` reaches this one with no change to Package.swift.
Outdated: swift-crypto — `swift-crypto` is resolved at 5.0.3, but 5.1.1 is the newest release tagged on https://github.com/apple/swift-crypto.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-crypto` reaches this one with no change to Package.swift.
Outdated: swift-log — `swift-log` is resolved at 1.16.2, but 1.17.0 is the newest release tagged on https://github.com/apple/swift-log within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-log` reaches this one with no change to Package.swift.
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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 377 file(s) — `Package.swift`, `Scripts/cost_jsonl_shape_survey.swift`, `Sources/AdaptiveRefreshCore/AdaptiveRefreshPolicyCore.swift`, `Sources/CodexBar/AgentSessionsStore.swift`, `Sources/CodexBar/ChartBarHoverSelection.swift`, … (+372 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1d936-09ca-70d4-bac2-111faa82d9b0 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 73 · Warnings: 3005 · Recommendations: 108 · Info: 10 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 08:39 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.